使用以下方法安装angular cli:
npm -g install angular/cli
使用节点8.6产生此错误:
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/user/.npm/_logs/2017-10-10T16_41_49_141Z-debug.log
更改为节点版本6.11.4会发生类似错误:
npm ERR! git clone --template=/Users/user/.npm/_git-remotes/_templates --mirror git@github.com:angular/cli.git /Users/user/.npm/_git-remotes/git-github-com-angular-cli-git-05516032: Cloning into bare repository '/Users/user/.npm/_git-remotes/git-github-com-angular-cli-git-05516032'...
npm ERR! git clone --template=/Users/user/.npm/_git-remotes/_templates --mirror git@github.com:angular/cli.git /Users/user/.npm/_git-remotes/git-github-com-angular-cli-git-05516032: Warning: Permanently added the RSA host key for IP address '64:ff9b::c01e:fd71' to the list of known hosts.
npm ERR! git clone --template=/Users/user/.npm/_git-remotes/_templates --mirror git@github.com:angular/cli.git /Users/user/.npm/_git-remotes/git-github-com-angular-cli-git-05516032: Permission denied (publickey).
npm ERR! git clone --template=/Users/user/.npm/_git-remotes/_templates --mirror git@github.com:angular/cli.git /Users/user/.npm/_git-remotes/git-github-com-angular-cli-git-05516032: fatal: Could not read from remote repository.
npm ERR! git clone --template=/Users/user/.npm/_git-remotes/_templates --mirror git@github.com:angular/cli.git /Users/user/.npm/_git-remotes/git-github-com-angular-cli-git-05516032:
npm ERR! git clone --template=/Users/user/.npm/_git-remotes/_templates --mirror git@github.com:angular/cli.git /Users/user/.npm/_git-remotes/git-github-com-angular-cli-git-05516032: Please make sure you have the correct access rights
npm ERR! git clone --template=/Users/user/.npm/_git-remotes/_templates --mirror git@github.com:angular/cli.git /Users/user/.npm/_git-remotes/git-github-com-angular-cli-git-05516032: and the repository exists.
npm ERR! Darwin 16.7.0
npm ERR! argv "/Users/user/.nvm/versions/node/v6.11.4/bin/node" "/Users/user/.nvm/versions/node/v6.11.4/bin/npm" "install" "-g" "angular/cli"
npm ERR! node v6.11.4
npm ERR! npm v3.10.10
npm ERR! code 128
npm ERR! Command failed: git clone --template=/Users/user/.npm/_git-remotes/_templates --mirror git@github.com:angular/cli.git /Users/user/.npm/_git-remotes/git-github-com-angular-cli-git-05516032
npm ERR! Cloning into bare repository '/Users/user/.npm/_git-remotes/git-github-com-angular-cli-git-05516032'...
npm ERR! Warning: Permanently added the RSA host key for IP address '64:ff9b::c01e:fd71' to the list of known hosts.
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!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /Users/user/npm-debug.log
我的Ubuntu远程服务器和我的本地MacBook都发生了这种情况,两者都在我的Github帐户中添加了有效的SSH密钥。
答案 0 :(得分:1)
它应该是@angular/cli
,因为angular/cli
是一个不存在的npm-package:
npm -g install @angular/cli
答案 1 :(得分:0)
正确的命令是: npm install -g @ angular / cli 你可以检查这个可以启动你的应用程序: https://angular.io/guide/quickstart