node.js - git clone了angular-phonecat项目后执行npm install时报错

 平凡随缘2010 发布于 2022-11-02 20:41

C:Usershpangular-phonecat>npm install

> angular-phonecat@0.0.0 postinstall C:\Users\hp\angular-phonecat
> bower install

bower angular#1.5.x             ENOGIT git is not installed or not in the PATH

    npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
    npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.12
    npm ERR! Windows_NT 10.0.10586
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js?1.2.1" "install"
    npm ERR! node v4.4.3
    npm ERR! npm  v3.9.6
    npm ERR! code ELIFECYCLE
    npm ERR! angular-phonecat@0.0.0 postinstall: `bower install`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the angular-phonecat@0.0.0 postinstall script 'bower install'.
    npm ERR! Make sure you have the latest version of node.js and npm installed.
    npm ERR! If you do, this is most likely a problem with the angular-phonecat package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     bower install
    npm ERR! You can get information on how to open an issue for this project with:
    npm ERR!     npm bugs angular-phonecat
    npm ERR! Or if that isn't available, you can get their info via:
    npm ERR!     npm owner ls angular-phonecat
    npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\hp\angular-phonecat\npm-debug.log
2 个回答
  • 你不是执行的bower install吗?

    2022-11-04 22:38 回答
  • 问题已解决。该问题是在win10的cmd命令切换到angular-phonecat下执行bower install时出现ENOGIT git is not installed or not in the PATH的错误,具体解决如下:

    方法一:配置Git的环境变量;
    git默认安装目录为C:\Program Files (x86)\Git,在系统变量的path中添加C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd;返回执行即可;

    方法二:使用Git Bash来替代cmd

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