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

Can't $ nvm run #625

Closed
ivan-kleshnin opened this issue Jan 22, 2015 · 4 comments
Closed

Can't $ nvm run #625

ivan-kleshnin opened this issue Jan 22, 2015 · 4 comments
Assignees
Labels
bugs Oh no, something's broken :-( feature requests I want a new feature in nvm!

Comments

@ivan-kleshnin
Copy link

$ nvm run 0.11 
Running node v0.11.15      <- "freezes" here, no caret
                           <- pressed enter 
                           <- again

2+2                        <- entered expression

^C> undefined              <- pressed Ctrl-C
> undefined
> undefined
> 4
> undefined
> 
paqmind@Paqmind:~$ 

It doesn't depend on node version. Tried $ nvm run 0.11, $ nvm run default, etc.
Same result. OS = last debian. Nvm was installed with linuxbrew (fresh install, everything updated)

$ nvm ls
    v0.10.35
->  v0.11.15
default -> unstable (-> v0.11.15)
stable -> 0.10 (-> v0.10.35) (default)
unstable -> 0.11 (-> v0.11.15) (default)
@ljharb
Copy link
Member

ljharb commented Jan 22, 2015

nvm run by itself is just supposed to open the node repl. Typically, you'd do nvm run 0.11 --version or some other command. Alternatively, you can run nvm exec 0.11 node --version.

However, homebrew is a completely unsupported way to install nvm. Please uninstall it, and use the install command on the readme: curl https://raw.githubusercontent.com/creationix/nvm/v0.23.0/install.sh | bash and then try again?

@ivan-kleshnin
Copy link
Author

Please uninstall it, and use the install command on the readme: curl

Done. Same issue. Node on itself is runnable:

paqmind@Paqmind:~$ which node
/home/paqmind/.nvm/v0.11.15/bin/node
paqmind@Paqmind:~$ node
> _

@ljharb
Copy link
Member

ljharb commented Jan 22, 2015

Ah - this is because nvm run runs its node command in a subshell, to avoid altering the current shell.

This is either a bug, because nvm run should error out when you provide no arguments, or a broken feature, because "no args" should drop you into the repl.

In the meantime, you can do nvm exec 0.11 node to get a repl in whatever version you like.

@ljharb ljharb added needs followup We need some info or action from whoever filed this issue/PR. bugs Oh no, something's broken :-( feature requests I want a new feature in nvm! labels Jan 22, 2015
@ljharb ljharb self-assigned this Jan 22, 2015
@ivan-kleshnin
Copy link
Author

Thank you! I confirm that nvm exec 0.11 node works.

@ljharb ljharb closed this as completed in d68f667 Apr 5, 2015
@ljharb ljharb removed the needs followup We need some info or action from whoever filed this issue/PR. label Oct 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs Oh no, something's broken :-( feature requests I want a new feature in nvm!
Projects
None yet
Development

No branches or pull requests

2 participants