npm won't install packages “npm ERR! network t

2019-05-04 19:21发布

I am having trouble with npm and node version 0.10.40. I never had this problem before and I am not behind a proxy. I have tried other solutions that I found on Stack Overflow and other forums such as changing the registry url to http://.. rather than https://.., and setting strict-ssl to false. When I do this npm is unable to parse JSON. Here is my npm-debug.log. Maybe someone can help me figure out what is going on.

npm-debug.log

4条回答
兄弟一词,经得起流年.
3楼-- · 2019-05-04 20:00

When you are behind the proxy in a corporate environment you would have used the following commands

npm config set proxy http://xxx.xxx.xxx.x:8080
npm config set https-proxy http://xxx.xxx.xxx.x:8080

When you are not just switch the proxy off by

npm config set proxy false
npm cache clean

查看更多
成全新的幸福
4楼-- · 2019-05-04 20:03

Best solution is:-

In case your npm is unable to build the phantomJS/CasperJS packages because of network proxy issue, simply download the casperjs and phantomjs manually and add to App_data folder in your C:/ folder.

Open your command prompt and execute below code:

npm config set proxy false
npm cache clean

Add the casperJS and phantomJS to your PATH variable of your machine.

Run the casperjs... problem will be resolved.

查看更多
该账号已被封号
5楼-- · 2019-05-04 20:08

I solved this issue by issuing the following commands

npm config set proxy false
npm cache clean

Apparently npm was attempting to bypass a proxy or believed it was behind a proxy. Strange.

查看更多
登录 后发表回答