NPM Slow Domestic Issue Resolution
Category Programming Technology
NPM is a package management tool that comes with NodeJS, which we often use to download third-party packages locally.
However, many people probably know that the speed of downloading third-party packages in China with NPM is extremely slow.
Today, I recommend using the Taobao NPM mirror, which is a complete mirror of npmjs.org. You can use this to replace the official version (read-only), and the synchronization frequency is currently once every 10 minutes to ensure as much synchronization with the official service as possible.
Taobao NPM mirror address: https://npm.taobao.org/
Usage Instructions
You can use the Taobao NPM mirror's custom cnpm (gzip compression support) command-line tool to replace the default npm:
npm install -g cnpm --registry=https://registry.npmmirror.com
Now you can use the cnpm command to install modules:
$ cnpm install [name]
Example
Install the Express development framework:
$ cnpm install express
Other Mirrors
Open Source Mirror: http://npm.taobao.org/mirrors
Alinode Mirror: http://npm.taobao.org/mirrors/alinode
PhantomJS Mirror: http://npm.taobao.org/mirrors/phantomjs
ChromeDriver Mirror: http://npm.taobao.org/mirrors/chromedriver
OperaDriver Mirror: http://npm.taobao.org/mirrors/operadriver
Selenium Mirror: http://npm.taobao.org/mirrors/selenium
Node.js Documentation Mirror: http://npm.taobao.org/mirrors/node/latest/docs/api/index.html
NPM Mirror: https://npm.taobao.org/mirrors/npm/
Electron Mirror: https://npm.taobao.org/mirrors/electron/
Node-Inspector Mirror: https://npm.taobao.org/mirrors/node-inspector/