【问题标题】:Multiple errors when running npm install -g angular-cli command运行 npm install -g angular-cli 命令时出现多个错误
【发布时间】:2016-11-03 16:51:20
【问题描述】:

运行命令 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

【问题讨论】:

  • 你的日志说Please check if you have git installed and in your PATH.是吗?
  • Git 已安装并在我的路径中,但仍然无法正常工作。来自 angular-cli 网站的 git 不是先决条件,我认为 git 的compression-webpack-plugin.git 中有一个错误。
  • 这是您第一次安装 angular-cli 还是安装了早期版本?
  • 是的,这是我第一次安装 angular-cli。

标签: angular npm angular-cli


【解决方案1】:

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

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

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

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

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

【讨论】:

  • 我已经尝试了所有方法来安装 GIT 并将其设置在系统路径中,但仍然无法正常工作。
【解决方案2】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-11
    • 2018-05-08
    • 2018-06-27
    • 1970-01-01
    • 2018-07-30
    • 1970-01-01
    相关资源
    最近更新 更多