[Environment construction] npm cannot be used after using nvm to download node

Download npm manually

  • After finding npm命令that it cannot be used, go to the folder corresponding to the node version downloaded by nvm to check and find that no npm related files have been downloaded.
  • Therefore, you need to manually download the npm version corresponding to the current node version and put it in the corresponding folder

First check the npm version corresponding to the current node

Put the npm file into the corresponding folder

  • Unzip the downloaded npm file and put it in the corresponding node version folder under the nvm file>node_modules>npm folder

insert image description here

  • And put the two files under the bin folder npmand npm.cmdthese two files under the node version file under nvm (as shown in the figure below)

insert image description here
insert image description here

  • Next, use npm -vthe wait command and run successfully!

Guess you like

Origin blog.csdn.net/qq_46043634/article/details/125700816