Skip to content
New issue

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

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

Already on GitHub? # to your account

Redux CLI exits with error #39

Closed
nurrony opened this issue Mar 2, 2016 · 7 comments
Closed

Redux CLI exits with error #39

nurrony opened this issue Mar 2, 2016 · 7 comments

Comments

@nurrony
Copy link

nurrony commented Mar 2, 2016

I installed redux-cli as per instruction like below

npm i -g redux-cli

and using node installed with nvm. When I run redux g dumb HelloWorld, redux-cli is throwing error

/usr/bin/env: node --harmony: No such file or directory

How to use it with node installed by NVM? I can symlink node to path where cli is looking for but looks like dirty hack to me.

@SpencerCDixon
Copy link
Owner

Are you sure you're using nvm and not system node? I would nvm ls to confirm.

Try doing this:

nvm install 5.1
nvm use 5.1
npm i redux-cli g
redux new <app name>

If that doesn't work lemme know

@nurrony
Copy link
Author

nurrony commented Mar 3, 2016

@SpencerCDixon Yes, I am sure. My nvm ls output is like below

$nvm ls
       v0.10.40
->       v5.7.0
node -> stable (-> v5.7.0) (default)
stable -> 5.7 (-> v5.7.0) (default)
iojs -> iojs- (-> N/A) (default)

Even after installing redux-cli as global, I am getting following error

$redux new redux-cli-test
/usr/bin/env: node --harmony: No such file or directory

my which node output is

$which node
/home/nmrony/.nvm/versions/node/v5.7.0/bin/node

BTW I am using Ubuntu 14.04

@SpencerCDixon
Copy link
Owner

Having a hard time trying to find a good fix (I also don't have ubuntu which I could test things with) I found this issue that might be of some help try running ln -s /usr/bin/nodejs /usr/bin/node and see if that fixes the issue

@alienspaces
Copy link

On Ubuntu.

Changing all executables to call node directly (instead of through env)

#!/usr/bin/node --harmony
require('../lib/cli');

See https://bbs.archlinux.org/viewtopic.php?id=168479

@nurrony
Copy link
Author

nurrony commented Mar 7, 2016

@SpencerCDixon I can symlink as I mentioned. but this does not solving the problem. Because I need to use different node versions for different projects. I can send you a PR but first I need to study your codes. Also are there any rules of contributions?

@SpencerCDixon
Copy link
Owner

Feel free to submit a PR that will fix it for Ubuntu users. I don't personally have Ubuntu set up or a way to test it, sorry :/

@nurrony
Copy link
Author

nurrony commented Mar 26, 2016

@SpencerCDixon I found a workaround while using various NodeJS with NVM. I set NodeJS stable version as default version to load by NVM while a new terminal window is opened as follows.

nvm alias default node

Then install redux-cli globally and it is working fine. BTW awesome work 👍 Please close this issue as seems resolved.

@alienspaces I go for #!/usr/bin/env node rather using #!/usr/bin/node as you already saw that my node executable is not in /usr/bin/node path using #!/usr/bin/env node ensure portability and more safe option

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants