npm upgrade with nvm
24-06-25
%I manage Node.js versions with nvm
for all my JavaScript/TypeScript projets. Lots of .nvmrc
files.
NPM comes always comes with and I've never had to update it before now.
Here is how I got NVM to use the latest minor version of Node.js 22 and NPM v11:
$ nvm use
Found '' with version <v22>
Now using node v22.3.0 (npm v10.8.1)
$ nvm install 22
Downloading and installing node v22.16.0...
Downloading https://nodejs.org/dist/v22.16.0/node-v22.16.0-darwin-arm64.tar.xz...
#################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v22.16.0 (npm v10.9.2)
$ nvm use
Found '' with version <v22.16.0>
Now using node v22.16.0 (npm v10.9.2)
$ nvm install-latest-npm
Attempting to upgrade to the latest working version of npm...
* Installing latest `npm`; if this does not work on your node version, please report a bug!
removed 14 packages, and changed 67 packages in 6s
25 packages are looking for funding
run `npm fund` for details
* npm upgraded to: v11.4.2
- [ nvm]