Http://www.cnblogs.com/enix/p/3635343.html
When installing node module with NPM, there is often a case of stuck installation failure. The reason is that the NPM server is in the United States, and there is a strong firewall role. This problem has led many novices to abandon the use of node, and almost every day a novice asks the question. Now share a solution to this problem
1. The proxy address can be modified once and for all
2. change NPM source to RP
Environmental validation
1. Determine your NPM config situation
NPM Config ls
2. Detailed
1.NPM Default Source Address
2. Location of the User configuration file
3. Proxy Server
4. User-configured Source address
modifying scenarios
1. Clay Turtle Type
Modify the NPM user profile. NPMRC, the path in the 2, if not the one from the base. Open an edit with a plain text editor
Choose one, agent is the best agent
The proxy address format is Http://www.xxxx.com:port
2. Literary and artistic fan
Use command-line tools to modify the command directly, or choose one of the two
NPM Config set proxy http://127.0.0.1:8087
NPM Config Set Registry http://registry.npmjs.org
The following will provide high-quality NPM source address, cnpm hehe.
3. Temporarily modify NPM source address during installation
NPM Install Express--registry http://registry.npmjs.org
Summarize
If you have a stable proxy server or use the proxy is the best
No proxy conditions can only be used to replace the source address of the way guerrilla.
NPM is not very stable abroad, after the installation failed to use NPM cache clean to clear the cache, multiple installation try.
You can use NPM Config set Strict-ssl false to disable HTTPS
I hope to be of some help to everyone
Finally, a site that provides a collection of NPM source addresses http://blog.modulus.io/npm-mirrors
[Nodejs] Domestic NPM installation Nodejs modules several solutions to failure