安装PhoneGap获取"找不到错误:git"

 旧日旧面 发布于 2023-01-09 10:25

使用node.js安装PhoneGap时,出现上述错误.我以Admin身份运行Node.js命令提示符.以下是日志中的完整错误列表:

370 error not found: git
371 error Failed using git.
371 error This is most likely not a problem with npm itself.
371 error Please check if you have git installed and in your PATH.
372 error System Windows_NT 6.2.9200
373 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "phonegap"
374 error cwd C:\Windows\System32
375 error node -v v0.10.28
376 error npm -v 1.4.9
377 error code ENOGIT
378 verbose exit [ 1, true ]

我已将我的git.exe路径添加到nodevars.bat文件中,当我在node.js cmd屏幕中输入'git'时,我得到了useage响应(证明git在路径中).

这是一台全新的机器,所以我可能会忽略一些东西,但我无法弄清楚是什么.

编辑:更多信息 - 我正在使用Windows 8.1,我正在使用"Node.js命令提示符"(窗口上的标题).我按照这里的说明操作:http://phonegap.com/install/

当我在提示符下键入git时,我得到:
C:\ Windows\System32> git usage:git [--version] [ - help] [-c name = value] [--exec-path [=]] [ - -html-path] [--man-path] [--info-path] [-p | --paginate | --no-pager] [ - no-replace-objects] [--bare] [ - git-dir =] [ - work-tree =] [--namespace =] []

2 个回答
  • 重新启动并尝试其他事情后,似乎npm脚本的某些部分没有找到git.我打开Git Shell并从那里运行命令.它安装.

    2023-01-09 10:28 回答
  • 我有同样的问题,但我安装了以前的版本,它正在工作.试试这个:npm install -g phonegap@3.4

    2023-01-09 10:29 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有