After installing nvm, you can switch the node version, but the npm version is still up to date. Why is npm unchanged?

npm is 5.6.When nvm switches to version 6.0of node,npm-v or 5.6, why is npm unchanged?

Apr.12,2021

nvm install-latest-npm


because npm itself is independent.
is similar to the relationship between mavne and jdk. Just because you have updated the jdk version does not mean that maven will be updated automatically.


Uninstall the globally installed version of node. Install nvm, first and then install node through nvm. The specific code is as follows:

nvm ls available
nvm install 8.12.0
nvm install 10.16.0
nvm use 8.12.0
node -v
npm -v
nvm use 10.16.0
node -v
npm -v
Menu