Question

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...

Was it helpful?

Solution 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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top