I have installed node/npm using the nvm documentation.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash
Then:
nvm install node
At this point node is working but the npm command result with:
npm: command not found
How can I have npm to work correctly ?
The npm command not found error js server, which you can download from the nodejs.org website. Once you downloaded and installed Node. js, open the terminal and run the npm -v command. Once you see the npm version, you should be able to run the npm install command again.
nvm installs Node which installs npm. If you don't need/want to switch between Node versions then you don't probably don't need nvm.
We strongly recommend using a Node version manager like nvm to install Node. js and npm. We do not recommend using a Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally.
I found out that this was a conflict with a previous versions of npm that have not been removed properly despite a apt-get remove node
.
I solved it by reinstalling npm from scratch:
rm -R ~/.npm ~/.nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
nvm install node
I found the solution here.
If you run NVM-Windows, don't forget to run nvm on
. (this solve the problem as title for me.)
I fixed this by doing this command:
$ command -v npm
and then reopen the shell window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With