[Nodejs] Domestic NPM installation Nodejs modules several solutions to failure

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.