电话差距npm安装错误

时间:2014-06-16 11:00:48

标签: android node.js cordova phonegap-build

在阅读了上面提到的phonegap入门指南之后,我已经安装了nodejs,我正在尝试使用npm install -g phonegap安装ponegap,但我在完成我已经搜索过的过程和google时遇到了问题任何解决方案和他们建议说的一些网站安装旧版本,好像新版本有错误,我尝试安装旧版npm install -g phonegap@3.4,但没有任何成效,任何帮助将不胜感激

这是我使用npm install -g phonegap

时遇到的错误
C:\Users\Admin>npm install -g phonegap
npm http GET https://registry.npmjs.org/phonegap
npm http 304 https://registry.npmjs.org/phonegap
npm http GET https://registry.npmjs.org/cordova
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/prompt
npm http GET https://registry.npmjs.org/connect-phonegap
npm http GET https://registry.npmjs.org/qrcode-terminal
npm http GET https://registry.npmjs.org/shelljs
npm http GET https://registry.npmjs.org/phonegap-build
npm http GET https://registry.npmjs.org/pluralize
npm http GET https://registry.npmjs.org/semver
npm ERR! not found: git
npm ERR!
npm ERR! Failed using git.
npm ERR! This is most likely not a problem with npm itself.
npm ERR! Please check if you have git installed and in your PATH.

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 C:\Users\Admin
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ENOGIT
npm http 304 https://registry.npmjs.org/connect-phonegap
npm http 304 https://registry.npmjs.org/prompt
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/cordova
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/qrcode-terminal
npm http 304 https://registry.npmjs.org/phonegap-build
npm http 304 https://registry.npmjs.org/pluralize
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/shelljs
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\Admin\npm-debug.log
npm ERR! not ok code 0

3 个答案:

答案 0 :(得分:1)

首先安装Git。试试这个链接http://git-scm.com/book/en/Getting-Started-Installing-Git

然后在您的“路径”中包含Git bin文件夹路径。环境变量中的变量。(C:\ Program Files(x86)\ Git \ bin)

答案 1 :(得分:0)

请按照以下步骤操作:

  1. 下载并安装Node.js。安装之后,您应该能够在命令行上调用node和npm。
  2. 如果您还没有git client,请下载并安装http://docs.phonegap.com/en/3.5.0/guide_cli_index.md.html#The%20Command-Line%20Interface。安装之后,您应该能够在命令行上调用git。
  3. 使用Node.js的npm实用程序安装cordova模块。 cordo模块将由npm实用程序自动下载。

    在OS X和Linux上: $ sudo npm install -g cordova

    在Windows上: C:\>npm install -g cordova

  4. 来源:{{3}}

    希望这有帮助。

答案 2 :(得分:0)

如此简单地更改您的npm注册表

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

以及安装上一版本的另一种方法

npm install -g phonegap@3.4

我猜这不是GIT的问题