nvm install success but reopen node version still the old version

Created on 23 Aug 2017  路  5Comments  路  Source: nvm-sh/nvm

  • Operating system and version:

  • nvm debug output:

$SHELL: /bin/bash
$NVM_DIR: '$HOME/.nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
nvm current: system
which node: /usr/local/bin/node
which iojs: 
which npm: /usr/local/bin/npm
npm config get prefix: /usr/local
npm root -g: /usr/local/lib/node_modules

  • nvm ls output:
iojs-v3.3.1
         v8.3.0
         v8.4.0
->       system
node -> stable (-> v8.4.0) (default)
stable -> 8.4 (-> v8.4.0) (default)
iojs -> iojs-v3.3 (-> iojs-v3.3.1) (default)

  • How did you install nvm? (e.g. install script in readme, homebrew):
    homebrew

  • What steps did you perform?

admindeMacBook-Pro-2:node-server admin$ nvm ls
iojs-v3.3.1
     v8.3.0
     v8.4.0
->       system
node -> stable (-> v8.4.0) (default)
stable -> 8.4 (-> v8.4.0) (default)
iojs -> iojs-v3.3 (-> iojs-v3.3.1) (default)
admindeMacBook-Pro-2:node-server admin$ node -v
v6.9.5
admindeMacBook-Pro-2:node-server admin$ nvm use v8.4.0
Now using node v8.4.0 (npm v5.3.0)
admindeMacBook-Pro-2:node-server admin$ node -v
v8.4.0
  • What happened?
    but when I reopen and run node -v,it return
    v6.9.5

  • What did you expect to happen?
    return still v8.4.0

  • Is there anything in any of your profile files (.bashrc, .bash_profile, .zshrc, etc) that modifies the PATH?
    maybe not

  • If you are having installation issues, or getting "N/A", what does curl -I --compressed -v https://nodejs.org/dist/ print out?


Most helpful comment

@qiuyaofan hm, i'm confused. nvm alias default node should set your default node version to "node" which is short for "latest" - after that, and restarting your shell, that should be the node version available by default.

Separately. nvm is not supported whatsoever when installed via homebrew - can you brew uninstall it, and reinstall it properly with the curl script in the readme?

All 5 comments

Run nvm alias default node?

return default -> node (-> v8.4.0),why still not change @ljharb can you help?

@qiuyaofan hm, i'm confused. nvm alias default node should set your default node version to "node" which is short for "latest" - after that, and restarting your shell, that should be the node version available by default.

Separately. nvm is not supported whatsoever when installed via homebrew - can you brew uninstall it, and reinstall it properly with the curl script in the readme?

sorry ,I am stupid,it works!Thanks you! @ljharb

np, glad it's working!

Was this page helpful?
0 / 5 - 0 ratings