1、下载 vue-element-admin 到本地,学习 vue2 开发。
node.js:12.18.2
2、npm install报错:
npm ERR! Error while executing:
npm ERR! D:\Program Files\Git\cmd\git.EXE ls-remote -h -t git://github.com/adobe-webplatform/eve.git
npm ERR!
npm ERR! fatal: unable to connect to github.com:
npm ERR! github.com[0: 20.205.243.166]: errno=Unknown error
npm ERR!
npm ERR!
npm ERR! exited with error code: 128
解决:
(1)重要!!!先清除 npm 缓存。
npm cache clean --force
(2)依赖下载使用 https 方式 代替 git 方式。
git config --global url."https://".insteadOf git:// 或 git config url."https://".insteadOf git://
(3)建议使用淘宝镜像拉取依赖。
npm install --registry=https://registry.npmmirror.com
感谢 DeepSeek,以上解决方案是根据DeepSeek给出的方案整理的。