The npm version does not change when I change the node version with the n library

1.7k Views Asked by At

I want my npm version to match my node version but no matter what node version I change it to with the n library the npm version is always 8.19.2. I am on a MAC running Monterey.

1

There are 1 best solutions below

2
shadowspawn On

You probably have more than one version of npm installed and in your PATH, and the version that n is updating is not the first npm found.

Where is the active npm installed? The default location that n installs to is:

$ command -v npm
/usr/local/bin/npm

If your OS has which, you can see all the locations at once (I just have one installed):

$ which -a npm
/usr/local/bin/npm