【问题标题】:Phone Gap npm installation errorPhone Gap npm安装错误
【发布时间】:2014-06-16 11:00:48
【问题描述】:

在阅读了上面提到的 phonegap 入门指南之后,我已经安装了 nodejs,我正在尝试使用 npm install -g phonegap 安装 ponegap,但我在完成我搜索过的过程和谷歌搜索任何一个过程时遇到了问题他们建议的解决方案和一些网站说安装旧版本,就好像新版本有错误一样,我尝试通过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

【问题讨论】:

    标签: android node.js cordova phonegap-build


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

      按照以下步骤操作:

      1. 下载并安装Node.js。安装后,您应该能够在命令行上调用 node 和 npm。
      2. 如果您还没有git client,请下载并安装。安装后,您应该可以在命令行上调用 git。
      3. 使用 Node.js 的 npm 实用程序安装 cordova 模块。科尔多瓦模块将由 npm 实用程序自动下载。

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

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

      来源http://docs.phonegap.com/en/3.5.0/guide_cli_index.md.html#The%20Command-Line%20Interface

      希望这会有所帮助。

      【讨论】:

        【解决方案3】:

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

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

        以及安装最新版本的另一种方式

        npm install -g phonegap@3.4
        

        我猜这不是 GIT 的问题

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2023-03-30
          • 2012-02-09
          • 2022-01-10
          • 2016-04-03
          • 1970-01-01
          • 2014-11-21
          • 2015-10-24
          相关资源
          最近更新 更多