[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
-
You can also enter the node version search
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
- And put the two files under the bin folder
npm
andnpm.cmd
these two files under the node version file under nvm (as shown in the figure below)
- Next, use
npm -v
the wait command and run successfully!