当我在Mac中运行npm安装时:
sudo npm install --save umi/dynamic umi/link umi/navlink umi/redirect umi/router umi/withRouter抛出此错误:
npm ERR! Error while executing:
npm ERR! /usr/local/bin/git ls-remote -h -t ssh://git@github.com/umi/router.git
npm ERR!
npm ERR! git@github.com: 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/dolphin/.npm/_logs/2019-09-10T01_52_01_900Z-debug.log为什么npm安装ssh访问github失败?我该怎么做才能修好它?
发布于 2019-09-10 05:21:23
当您将git存储库作为package.json文件中的依赖项列出时,就会发生这种情况。
"somepackage": "git://github.com/someorg/somerepo.git"如果存储库是public,则将该URL交换为HTTP:
"somepackage": "https://github.com/someorg/somerepo"如果存储库是私有的,则在项目设置>签出SSH键中启用用户密钥。有关详细信息,请参阅本文件。
发布于 2021-09-05 13:40:28
有时,您需要删除package-lock.json或yarn.lock,这样它才能作为这些缓存来解析包。
发布于 2022-01-10 05:21:28
我个人所做的一切都很清楚:
rm -rf node_modules
rm -rf package-lock.json
npm cache clean --force
php artisan cache:clear (create data folder if fails)
php artisan key:generate
php artisan config:clear
php artisan migrate:refresh --seed
composer update
git pull origin BRANCHNAME
npm install在那之后似乎起作用了。在执行npm安装之前,可能只需运行git pull origin BRANCHNAME就可以获得相同的结果,但是事先执行了其他命令,所以我不能100%地知道其他命令是否有用
https://stackoverflow.com/questions/57864368
复制相似问题