运行npm install -g angular-cli命令时出现多个错误

时间:2016-09-30 17:33:46

标签: angular npm angular-cli

当我运行命令npm install -g angular-cli时,我遇到了多个错误 我在Windows 10 64位。看一下我的日志

npm ERR! git clone --template=C:\Users\ben\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:webpack/compression-webpack-plugin.git C:\Users\ben\AppData\Roaming\npm-cache\_git-remotes\git-github-com-webpack-compression-webpack-plugin-git-7e55907cd54a2e91b96d25a660acc6a2a6453f54-e286d0b5: undefined
npm ERR! git clone --template=C:\Users\ben\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:webpack/compression-webpack-plugin.git C:\Users\ben\AppData\Roaming\npm-cache\_git-remotes\git-github-com-webpack-compression-webpack-plugin-git-7e55907cd54a2e91b96d25a660acc6a2a6453f54-e286d0b5: undefined
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" "install" "-g" "angular-cli"
npm ERR! node v6.2.0
npm ERR! npm  v3.8.9
npm ERR! code ENOGIT

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! Please include the following file with any support request:
npm ERR!     C:\Users\ben\npm-debug.log

2 个答案:

答案 0 :(得分:0)

您需要在计算机上安装Git。所以,请按照以下步骤仔细检查所有内容。它可能会对你有所帮助:

安装Git后,您需要添加" C:\ Program Files \ Git \ cmd"和" C:\ Program Files \ Git \ bin" (您的安装路径)到系统路径。(单击开始菜单=>编辑系统环境变量)

  • 重新打开命令窗口(重要步骤)

  • 在cmd窗口中运行Path命令,你应该在路径中看到Git

  • 安装Cli> npm install -g angular-cli

答案 1 :(得分:0)

@Bento在cmd窗口中执行path命令时,是否在路径列表中获得了GIT? 你应该得到这样的东西: enter image description here