I'm having issues with npm
in a Vagrant box I'm setting up. I noticed that the npm
version is somewhat old, so I wanted to check the problem with the latest release.
It is my understanding that you should be able to update npm
using npm install -g npm
, but the command has no effect on the npm
being used:
vagrant@box:~$ npm -v
1.3.10
vagrant@box:~$ sudo npm install -g npm
npm http GET https://registry.npmjs.org/npm
npm http 200 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/-/npm-2.1.12.tgz
npm http 200 https://registry.npmjs.org/npm/-/npm-2.1.12.tgz
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
[email protected] /usr/local/lib/node_modules/npm
vagrant@box:~$ npm -v
1.3.10
I also tried using n
(as suggested in How can I update my nodeJS to the latest version?) to update, but it affects neither npm
nor node
:
vagrant@box:~$ node -v
v0.10.25
vagrant@box:~$
vagrant@box:~$ sudo npm install -g n
/usr/bin/n -> /usr/lib/node_modules/n/bin/n
[email protected] /usr/lib/node_modules/n
vagrant@box:~$ sudo n stable
install : v0.10.33
mkdir : /usr/local/n/versions/0.10.33
fetch : http://nodejs.org/dist/v0.10.33/node-v0.10.33-linux-x64.tar.gz
installed : v0.10.33
vagrant@box:~$ node -v
v0.10.25
vagrant@box:~$ npm -v
1.3.10
What do I have to do to update npm to the latest version?
2.1.12
, which is the latest release: github.com/npm/npm/releases-g
should be placed somewhere else on the command line.which npm
is very helpful. Oldnpm
was in/usr/local/bin
and has priority above/usr/bin
new one