Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"/usr/bin/env: node --harmony: No such file or directory" error on Ubuntu 15.10 #42

Closed
adjioev opened this issue Mar 4, 2016 · 6 comments
Labels

Comments

@adjioev
Copy link

adjioev commented Mar 4, 2016

Hi,

I've installed redux-cli with:
sudo npm -g install redux-cli
And I get the following error:
`/usr/bin/env: node --harmony: No such file or directory

Env:

:~/sandbox$ node -v
v5.7.0
:~/sandbox$ npm -v
3.6.0

Looks like there is a problem with bang sign, here is a link with similar error:
azproduction/node-mc#3

Thanks Alex
`

@yedlosh
Copy link

yedlosh commented Mar 4, 2016

I have the same problem.

Env: same node and npm as OP, Ubuntu 14.04 LTS.

@SpencerCDixon
Copy link
Owner

Will try to get to it over the weekend

@SpencerCDixon
Copy link
Owner

@yedlosh
Copy link

yedlosh commented Mar 5, 2016

As pointed out in #39 the problem is that Linux kernel does not support multiple arguments in shebangs, so you can't pass the --harmony flag using
#!/usr/bin/env node --harmony

Naive solution to this problem would be to not use env but directly call
#!/usr/bin/node --harmony

But that creates another problem, as the node might be installed somewhere else.

I found this hack for passing arguments to shebang.
But there is already a wrapper on github made exactly for this use case, so you might just want to use this one:

https://github.com/olov/node-harmony-wrapper

@yedlosh
Copy link

yedlosh commented Mar 5, 2016

There is a question though, if you should even bother to use --harmony flag, as most of the ES6 features are already active in Node without need for any flags.

The only features --harmony activates are now:
Symbol.toStringTag, Array.prototype.includes and Rest Parameters (see here)

@anithri
Copy link
Collaborator

anithri commented Sep 18, 2017

I'm not familiar enough with node to understand all of the nuances of this. I"m running fine on Ubuntu 16.04 with just #!/usr/bin/env node

I'm closing this for now.

@anithri anithri closed this as completed Sep 18, 2017
hiro5id referenced this issue in imjuni/create-ts-index Apr 24, 2020
* output option set created file name
  * ex> -o webpack_entry.ts // this setting create filename webpack_entry.ts
* Apply Webpack
  * webpack build & optimization: tree-shalking, dead code elimination, uglify
* Refactor configure
  * performance tunning & easy reading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants