npm install -g cordova。 这么多的错误。 请帮助

我想开发一个使用cordova(PhoneGap)的应用程序。 我正在尝试使用“cordova文档”来安装cordova。 但是我总是在这些事情上低调。 我已经完成了这些步骤:

  1. 下载并安装Node.js
  2. 下载并安装一个git客户端
  3. 使用Node.js的npm工具安装cordova模块

而在第3步,我得到了很多错误。

我input了一个命令:

C:> npm install -g cordova

我有这样的回应:

C:\>npm install -g cordova npm WARN engine npm@1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node": "0.12.3","npm":"2.9.1"}) npm WARN engine cordova-js@3.9.0: wanted: {"node":"~0.10.x"} (current: {"node":" 0.12.3","npm":"2.9.1"}) npm WARN installMany normalize-package-data was bundled with npm@1.3.4, but bund led package wasn't found in unpacked tree npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: { "node":"0.12.3","npm":"2.9.1"}) npm ERR! Windows_NT 6.1.7601 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.3 npm ERR! npm v2.9.1 npm ERR! code ECONNRESET npm ERR! errno ECONNRESET npm ERR! syscall read npm ERR! network read ECONNRESET 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! Windows_NT 6.1.7601 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.3 npm ERR! npm v2.9.1 npm ERR! code ECONNRESET npm ERR! errno ECONNRESET npm ERR! syscall read npm ERR! network read ECONNRESET 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! Windows_NT 6.1.7601 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.3 npm ERR! npm v2.9.1 npm ERR! code ECONNRESET npm ERR! errno ECONNRESET npm ERR! syscall read npm ERR! network read ECONNRESET 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! Windows_NT 6.1.7601 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.3 npm ERR! npm v2.9.1 npm ERR! code ECONNRESET npm ERR! errno ECONNRESET npm ERR! syscall read npm ERR! network read ECONNRESET 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! Windows_NT 6.1.7601 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.3 npm ERR! npm v2.9.1 npm ERR! code ECONNRESET npm ERR! errno ECONNRESET npm ERR! syscall read npm ERR! network read ECONNRESET 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' C:\Users\UltimateUser\AppData\Roaming\npm\cordova -> C:\Users\UltimateUser\AppDa ta\Roaming\npm\node_modules\cordova\bin\cordova cordova@5.0.0 C:\Users\UltimateUser\AppData\Roaming\npm\node_modules\cordova ├── underscore@1.7.0 ├── q@1.0.1 ├── nopt@3.0.1 (abbrev@1.0.6) └── cordova-lib@5.0.0 (valid-identifier@0.0.1, osenv@0.1.0, properties-parser@0. 2.3, bplist-parser@0.0.6, mime@1.2.11, unorm@1.3.3, semver@2.1.0, shelljs@0.3.0, elementtree@0.1.5, rc@0.5.2, d8@0.4.4, cordova-app-hello-world@3.9.0, dep-graph @1.1.0, through2@0.6.3, xcode@0.6.7, plist@1.1.0, glob@4.0.6, npmconf@0.1.16, np m@1.3.4, cordova-registry-mapper@1.1.5, tar@1.0.2, init-package-json@1.6.0, requ est@2.47.0, cordova-js@3.9.0) npm ERR! Windows_NT 6.1.7601 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.3 npm ERR! npm v2.9.1 npm ERR! Callback called more than once. npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! <https://github.com/npm/npm/issues> npm ERR! Please include the following file with any support request: npm ERR! C:\npm-debug.log 

问题:

  1. 有没有作出任何改变,我的意思是我可以再次重复命令再次成功,或者我必须“清理”这个“一切都出错”命令后的东西?
  2. 我没有使用任何代理(虽然我不知道有关连接,家庭成员正在从另一个设备在YouTube上上传video)。 它能影响吗?
  3. 这一切都是因为我没有下载SDK。 (对不起)
  4. 我也在“安全模式”+ CMD +互联网,因为我的上网本是非常古老和缓慢,我使用这种模式,当我需要加快。 这是原因吗?

所以,毕竟,我可以重复一切(在下载sdk和使用连接没有任何“负载”)。 或之前,我必须清理我以前的尝试做的混乱?

请帮忙。 不要太严厉地判断。 🙂

更新:安装SDK后,做“安全模式”以外的一切,我有这样的:

 C:\>npm install -g cordova npm WARN engine npm@1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node": "0.12.3","npm":"2.9.1"}) npm WARN engine cordova-js@3.9.0: wanted: {"node":"~0.10.x"} (current: {"node":" 0.12.3","npm":"2.9.1"}) npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: { "node":"0.12.3","npm":"2.9.1"}) npm WARN installMany normalize-package-data was bundled with npm@1.3.4, but bund led package wasn't found in unpacked tree C:\Users\UltimateUser\AppData\Roaming\npm\cordova -> C:\Users\UltimateUser\AppDa ta\Roaming\npm\node_modules\cordova\bin\cordova cordova@5.0.0 C:\Users\UltimateUser\AppData\Roaming\npm\node_modules\cordova ├── underscore@1.7.0 ├── q@1.0.1 ├── nopt@3.0.1 (abbrev@1.0.6) └── cordova-lib@5.0.0 (valid-identifier@0.0.1, osenv@0.1.0, properties-parser@0. 2.3, bplist-parser@0.0.6, mime@1.2.11, unorm@1.3.3, semver@2.1.0, rc@0.5.2, shel ljs@0.3.0, dep-graph@1.1.0, npmconf@0.1.16, through2@0.6.3, xcode@0.6.7, d8@0.4. 4, init-package-json@1.6.0, elementtree@0.1.5, request@2.47.0, glob@4.0.6, cordo va-registry-mapper@1.1.5, tar@1.0.2, plist@1.1.0, cordova-app-hello-world@3.9.0, npm@1.3.4, cordova-js@3.9.0) 

我有同样的错误,我通过更新NPM修复它

 npm install npm -g 

我希望这个对你有用

你有没有尝试更新npm? 请用admin / root权限更新/安装npm。 这里是更新npm的快速命令npm update [-g]如需进一步阅读,请参考npm update doc