首页 > 解决方案 > 在 mac 中运行(npm install -g @angular/cli)时出错

问题描述

我正在尝试安装 angular/cli,当我在终端中运行 npm install -g @angular/cli 时,我提出了这些错误消息,此外,我尝试使用 sudo 作为前缀,但又不是一个积极的结果。

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/angular/cli.git
npm ERR! 
npm ERR! Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! 
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/username/.npm/_logs/2018-10-06T04_44_40_632Z- debug.log

标签: node.jsangulargitnpmangular-cli

解决方案


最后,我找到了答案这是刚刚在终端中运行的代码:

sudo npm install -g @angular/cli 

推荐阅读