I have installed node via nvm. I am trying to update npm. Current version:
npm -v
1.4.28
$ which npm
/Users/per/.nvm/v0.10.33/bin/npm
$ node -v
v0.10.33
Installing npm:
cd
curl -L https://npmjs.org/install.sh | sh
/Users/per/.node/bin/npm -> /Users/per/.node/lib/node_modules/npm/bin/npm-cli.js
npm@2.1.11 /Users/per/.node/lib/node_modules/npm
It worked
Checking npm version after install:
npm -v
1.4.28
$ which npm
/Users/per/.nvm/v0.10.33/bin/npm
How do I get npm to install itself in the nvm directory?
EDIT =================================
The root cause for wanting to replace npm with a new version is that I get a load of error messages when using it. One of the messages say:
imagemin@3.1.0: wanted: {"node":">=0.10.0","npm":">=2.1.5"} (current:{"node":"0.10.33","npm":"1.4.28"})
So that one seems to explicitly ask for a newer version of npm. The others are mostly about "Unmet dependencies". There are loads of them, but here is one example:
npm WARN unmet dependency /Users/per/.node/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/request/node_modules/form-data requires async@'~0.9.0' but will load