npm不会安装软件包“npm ERR! networking隧道套接字无法build立,导致=parsing错误“

我有npm和节点版本0.10.40的麻烦。 我以前从来没有遇到过这个问题,而且我也不是一个代理。 我已经尝试了其他解决scheme,我发现堆栈溢出和其他论坛,如更改registryurl http:// ..而不是https:// ..,并将strict-ssl设置为false。 当我这样做时,npm无法parsingJSON。 这是我的npm-debug.log。 也许有人可以帮我弄清楚发生了什么事情。

NPM-的debug.log

我通过发出以下命令来解决这个问题

npm config set proxy false npm cache clean 

显然npm试图绕过一个代理或相信它是在一个代理的背后。 奇怪。

当您在公司环境中代理后面时,您将使用以下命令

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

当你不只是closures代理

npm config set proxy false
npmcaching清理

最好的解决办法是:

如果您的npm由于networking代理问题而无法构buildphantomJS/CasperJS包,只需手动下载casperjsphantomjs ,并将其添加到C:/文件夹中的phantomjs文件夹。

打开命令提示符并执行以下代码:

 npm config set proxy false npm cache clean 

casperJSphantomJS添加到您机器的PATHvariables中。

运行casperjs …问题将得到解决。