Reputation: 979
I'm using nvm to be able to switch node versions but when I try and install a global package with npm install -g
it keeps installing to /Users/<username>/.nvm/versions/node/v8.9.4/bin/
even though doing node -v
shows version 9.10.0
Basically when I change node version using nvm use ...
I want my global packages to go to the correct node version.
Thanks for any help
Upvotes: 7
Views: 22916
Reputation: 816
The issue can most probably be with the NodeJS installation via nvm or the nvm.
The best solution can be to completely uninstall the nvm ( which'll eventually remove NodeJS alongside npm and if not, manually remove it using synaptic package manager or terminal) and reinstall it again.
To remove nvm:
sudo apt-get remove nvm && sudo apt-get purge nvm
To reinstall nvm again,
Upvotes: 0