Accelerating Access to npm and Yarn in China by Changing the Source
Background
By default, npm and Yarn use overseas source addresses, resulting in slow access in China.
You can check the current mirror source being used with the following command:
Solution
Utilize the cgr software to quickly switch between mirror sources for npm and Yarn.
Installing cgr
Listing currently available mirror sources
Selecting a mirror source to switch to (e.g., Taobao)
Testing access speed
References and Acknowledgments
- Yarn Acceleration in China: Modifying Mirror Sources
- cgr - Change Registry: Yarn & npm Registry Manager
Original: https://wiki-power.com/ This post is protected by CC BY-NC-SA 4.0 agreement, should be reproduced with attribution.
This post is translated using ChatGPT, please feedback if any omissions.