DEV Community

Discussion on: Nodenv Cheatsheet

Collapse
 
kyleridolfo profile image
Kyle Ridolfo

How do you handle minor npm version updates with this? Let's say my project node is at 20.10.0 but my global node is a running 18.x. When I use npm in my project folder it says I can update from npm 10.2.3 to 10.3.0. Will running npm install -g npm@10.3.0 put my global npm out of sync with my global node? Hope that makes sense.

Collapse
 
ahandsel profile image
ahandsel

Hello @kyleridolfo ,

I believe you can run npm install -g npm@10.3.0 as long as you have node v20.11.0 set globally.

In terms of steps:

  1. nodenv install 20.11.0
  2. nodenv global 20.11.0
  3. Restart terminal
  4. npm install -g npm@10.3.0

I hope this helps