Closed wonbyte closed 3 years ago
@wonbyte Try:
npm install --global npm
Here's how that went for me:
$ nvm install 6
Installing Node v6.17.1 lts/boron
Fetching https://nodejs.org/dist/v6.17.1/node-v6.17.1-darwin-x64.tar.gz
Now using Node v6.17.1 (npm 3.10.10) ~/.local/share/nvm/v6.17.1/bin/node
$ npm --version
3.10.10
$ npm install --global npm
...
$ npm --version
6.14.11
@jorgebucaran I'm assuming this works bc nvm.fish
has the --global
pointing to the current node nvm environment? To be clear, I only want to update the npm
that is associated with the corresponding active nvm
environment.
I'm assuming this works bc nvm.fish has the --global pointing to the current node nvm environment?
Correct.
$ type npm
npm is /home/jb/.local/share/nvm/v6.17.1/bin/npm
To be clear, I only want to update the npm that is associated with the corresponding active nvm environment.
That's what it does. It replaces the npm bundled with the active Node, the one managed by nvm in this case.
Is there a way to update
npm
similiar to how nvm.sh does it i.e.nvm install-latest-npm
? If not, is what's the best approach to do it?