What is the method for setting up a mirror for npm?
There are several ways to set up an npm mirror.
- Set the image using the command line: You can set the image using the following command:
npm config set registry <registry-url>
- Configuration file for npm
- The npm configuration file.
registry=<registry-url>
Similarly,
- Previous.
- – Natural Resource Management
- I love it
npm install -g nrm
nrm use <registry-name>
In this case,
No matter which method you use to set up a mirror, when running commands such as npm install, npm will download dependencies from the specified mirror address.