Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
155 views
in Technique[技术] by (71.8m points)

javascript - npm install error/issue

I have already set proxy configurations in .npmrc file. Executing the npm install command gives me error as follows"

$ npm install npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:Program Files odejs ode.exe" "C:Program Files odejs ode_modules pmin pm-cli.js" "install" npm ERR! node v6.9.4 npm ERR! npm v3.10.10 npm ERR! code ECONNRESET

npm ERR! network tunneling socket could not be established, statusCode=400 npm ERR! network This is most likely not a problem with npm itself npm ERR! network and is related to network connectivity. npm ERR! network In most cases you are behind a proxy or have bad network settings. npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! Please include the following file with any support request: npm ERR! D:Poojaquickstart pm-debug.log

The .npmrc file in user folder contains following values

 1. registry=https://registry.npmjs.org/
 2. proxy=http://[email protected]:8080/
 3. http_proxy=http://username:password@[email protected]:8080/

Is there any way to solve this issue?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Does your proxy URL have '@' symbol in it? @ symbol separates the user ID and password from the URL. If it does, you can try using '%40' to replace it.

Also, it is https-proxy not http_proxy.

A correct config would look like -

registry=https://registry.npmjs.org/
proxy=http://username:password@proxydomain:8080/
https-proxy=https://username:password@proxydomain:8080/

https://docs.npmjs.com/misc/config#proxy


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...