vue-admin-element安装依赖报错

在安装vue-admin-element过程中遇到权限错误,由于npm包使用ssh协议且本地缺少ssh密钥。解决方案是将ssh协议转换为https,通过`gitclone`命令克隆仓库并使用`npminstall--registry=https://registry.npm.taobao.org`进行安装。

在安装vue-admin-element的过程中经常会出现打包git@github.com: Permission denied (publickey).错误,原因是npm包的作者使用的ssh协议导致,本地.ssh又没有配置秘钥,无法下载代码到本地,强制转换ssh协议成https

npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 128
npm ERR! npm ERR! An unknown git error occurred
npm ERR! npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/adobe-webplatform/eve.git
npm ERR! npm ERR! git@github.com: Permission denied (publickey).
npm ERR! npm ERR! fatal: Could not read from remote repository.
npm ERR! npm ERR! 
npm ERR! npm ERR! Please make sure you have the correct access rights
npm ERR! npm ERR! and the repository exists.

git强制转换ssh成https协议,之后就可以打包了

git clone https://github.com/PanJiaChen/vue-element-admin.git .
git config --global url."https://github".insteadOf git://github
npm -v
npm install --registry=https://registry.npm.taobao.org
npm run dev

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值