错误! Windows_NT 6.3.9600,无法在 windows8 中安装 cordova

npm ERR! Windows_NT 6.3.9600, unable to install cordova in windows8

我试图通过在命令提示符

中使用以下命令在我的 windows8 机器上安装 cordova
npm install -g cordova

但是由于出现以下错误,我无法安装,请大家帮帮我。

错误:

npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs \node_modules\npm\bin\npm-cli.js" "install" "-g" "cordova" npm ERR! node v0.12.1 npm ERR! npm v2.5.1 npm ERR! code ECONNRESET

npm ERR! network tunneling socket could not be established, cause=getaddrinfo EN OTFOUND proxy 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 settin gs. 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! C:\Users\miracle\npm-debug.log

您应该执行的步骤:

  1. npm 缓存清理

2.Bring 将节点版本恢复到 v0.10.36,因为最新版本的节点可能与 window 用户的新 cli 不兼容。

3.Run管理员模式下的节点cli或cmd

4.npm 安装-g cordova

我正在使用 node:0.12.5,npm:2.12.0。我遇到了同样的问题,我的简单解决方案就是使用这个命令:

npm cache clean

然后使用您的包的安装命令,在本例中

npm install -g cordova

这对我有用:

npm config set proxy=http://127.0.0.1:8087

npm config set registry=http://registry.npmjs.org

127.0.0.1:8087是我的代理和代理端口,你们自己去吧