nvm: node and npm not found
I am new to Macos,I already have nvm,and installed node v6.2.0 and set it as default,but i cannot find node and npm,i also set
export NVM_DIR="/Users/myname/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
in ~/.bashrc and ~/.bash_profile,and print the path it turns out
192:~ myname$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
and the problem is
192:~ myname$ nvm list
v6.2.0
current -> v6.2.0
node -> stable (-> v6.2.0) (default)
stable -> 6.2 (-> v6.2.0) (default)
iojs -> N/A (default)
lts/* -> lts/boron (-> N/A)
lts/argon -> v4.6.2 (-> N/A)
lts/boron -> v6.9.1 (-> N/A)
192:~ myname$ node -v
-bash: node: command not found
192:~ myname$ npm -v
-bash: npm: command not found
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 37 (7 by maintainers)
Most of the guidelines on nvm miss the fact that you need to enter in each shell:
nvm use node
Please check if
node -v
works after that. To be able to run it always, use this command:nvm alias default node
sudo rm -rf ~/.nvm then reinstall