安装phonegap时npm git错误代码0

时间:2014-06-30 11:25:23

标签: git cordova npm

安装phonegap时会发出以下错误,

$npm install -g phonegap
    npm ERR! git fetch -a origin (git://github.com/apache/cordova-lib.git) fatal: un
    able to connect to github.com:
    npm ERR! git fetch -a origin (git://github.com/apache/cordova-lib.git) github.co
    m[0: 192.30.252.131]: errno=No error
    npm ERR! Error: Command failed: fatal: unable to connect to github.com:
    npm ERR! github.com[0: 192.30.252.131]: errno=No error
    npm ERR!
    npm ERR!
    npm ERR!     at ChildProcess.exithandler (child_process.js:647:15)
    npm ERR!     at ChildProcess.emit (events.js:98:17)
    npm ERR!     at maybeClose (child_process.js:755:16)
    npm ERR!     at Process.ChildProcess._handle.onexit (child_process.js:822:5)
    npm ERR! If you need help, you may report this *entire* log,
    npm ERR! including the npm and node versions, at:
    npm ERR!     

    npm ERR! System Windows_NT 6.1.7601
    npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
    ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "phonegap"
    npm ERR! cwd D:\TSC Project
    npm ERR! node -v v0.10.29
    npm ERR! npm -v 1.4.14
    npm ERR! code 128
    npm ERR!
    npm ERR! Additional logging details can be found in:
    npm ERR!     D:\TSC Project\npm-debug.log
    npm ERR! not ok code 0

我在安装git之后也安装了git,仍然给出了错误

1 个答案:

答案 0 :(得分:2)

我遇到了同样的问题,我安装了git,但是在我更改npm注册表之后仍然给出了错误。现在工作正常。

npm config set registry http://registry.npmjs.eu
npm install phonegap -g