1. Introduction of NRM
NRM (full name: NPM Registry Manager) can easily manage the registry source currently used by NPM. With NRM, we can quickly switch the NPM source.
2. The NRM installation
You are advised to install the NRM globally
npm install -g nrm // Global installation
Copy the code
After the installation is successful, you can view the NRM version
nrm --version
Copy the code
3. List the currently available sources
nrm ls
Copy the code
The asterisk indicates the source that is currently in use
4. Switch to the NPM source
nrm use yarn
Copy the code
5. Add an NPM source
NRM add <registry> <url> [home] NRM add MNPM HTTPS://xxx.com/registry/
Copy the code
Registry is the name of the source, URL is the address of the source, and home is the home page of the source [Optional]
6. Delete the NPM source
NRM del <registry> For example, NRM del MNPMCopy the code
Registry is the name of the source
7. Test NPM speed
Test the speed of all NPM sources
nrm test
Copy the code