I have installed NVM, and now I am trying to install NPM so I can import my packages for my nodejs application. I run a digitalocean vps.

If I type

"node -v"

I get the 0.10.19 version that is installed in my nvm folder. The folder is ~/.nvm/v0.10.19/bin. Typing "node -v" confirms that I have my $PATh works properly.

When I run the sh install.sh script to install NPM, I get the following error:

npm cannot be installed without nodejs. Install node first, and then try again.

Maybe node is installed, but not in the PATH? Note that running as sudo can change envs.

PATH=~/.nvm/v0.10.19/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

I'm really confused, since the path to the node executable is actually printed out in the console when the sh fails...

有帮助吗?

解决方案 2

nodejs version 0.10.19 should come with npm with it. Pleas issue the below command

npm -v

I have nodejs version 0.10.15 and it installed npm for me.

其他提示

Do not run npm commands with sudo. nvm is installed in your home directory in part because it is intended to be used as a normal user not root.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top