npm安装时出现拉取git仓库错误问题修复措施研究
Published in:2024-07-05 |
Words: 153 | Reading time: 1min | reading:

错误内容

错误详情

1
2
3
4
5
6
7
8
9
10
11
czq@czq-virtual-machine:~/Desktop/blog/hexo-bamboo-blog$ sudo npm install
npm error code 128
npm error An unknown git error occurred
npm error command git --no-replace-objects ls-remote ssh://git@github.com/CodeFalling/hexo-asset-image.git
npm error git@github.com: Permission denied (publickey).
npm error fatal: Could not read from remote repository.
npm error
npm error Please make sure you have the correct access rights
npm error and the repository exists.

npm error A complete log of this run can be found in: /root/.npm/_logs/2024-07-05T01_37_00_386Z-debug-0.log

How to fix the prolem

1
2
3
ssh-keygen -t rsa -C mail@qq.com
cat ~/.ssh/id_res.pub
# add rsa to github.com

switch node version to point

1
2
3
4
sudo apt install npm
sudo npm install n -g
sudo n lts
sudo node -v

switch mirror to tb mirror

1
2
npm config set registry http://registry.npm.taobao.org/
npm config get registry
Prev:
OpenCV build and install on ubuntu
Next:
毕业设计预览