Android Phone Gap npm安装错误

Android Phone Gap npm安装错误,android,node.js,cordova,phonegap-build,Android,Node.js,Cordova,Phonegap Build,在阅读了上面提到的phonegap入门指南后,我安装了nodejs,我正试图使用npm install-g phonegap安装ponegap,但在完成我搜索和谷歌搜索的任何解决方案和一些他们建议安装旧版本的网站的过程中,我遇到了一个问题版本,就像新版本有bug一样,我尝试通过npm install-g安装旧版本phonegap@3.4但没有任何结果,我们将感谢您的帮助 这就是我在使用npm安装-g phonegap C:\Users\Admin>npm install -g phoneg

在阅读了上面提到的phonegap入门指南后,我安装了nodejs,我正试图使用
npm install-g phonegap
安装ponegap,但在完成我搜索和谷歌搜索的任何解决方案和一些他们建议安装旧版本的网站的过程中,我遇到了一个问题版本,就像新版本有bug一样,我尝试通过
npm install-g安装旧版本phonegap@3.4
但没有任何结果,我们将感谢您的帮助

这就是我在使用
npm安装-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

首先安装Git。试试这个链接

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

按照以下步骤操作:

  • 下载并安装。安装之后,您应该能够在命令行上调用node和npm
  • 如果您还没有,请下载并安装。安装之后,您应该能够在命令行上调用git
  • 使用Node.js的npm实用程序安装cordova模块。cordova模块将由npm实用程序自动下载

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

    在Windows上:
    C:\>npm安装-g cordova

  • 来源


    希望这能有所帮助。

    只需更改npm注册表即可

    npm config set registry http://registry.npmjs.eu
    npm install -g phonegap
    
    还有另一种安装最新版本的方法

    npm install -g phonegap@3.4
    
    我想这不是GIT的问题