报错信息:
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/*****.git
npm ERR! Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
原因分析:
install过程中某些包需要github.com的认证,而你本地的git配置了指向公司或者别处的url,导致失败,修改git的全局配置即可
解决办法:
先设置git配置文件编辑器
git config --global core.editor vim
编辑命令
git config --global edit
删除配置文件中多余的内容,使配置文件中最多包含以下内容(若您之前有其他配置,请先备份,这样配置是肯定能解决问题的)
[user]
name = xxx
email = xxxxxx@***.com
[core]
editor = vim
重新执行 npm install即可