Vue项目Vue element admin 启动报错 C:UsersAdministratorAppDataRoaming pm-cache\_logs2021-05-24T03_13_25_959Z-debug.log【已解决】

在svn拉取代码后,npm install 运行项目报错,错误信息如下:

npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/sohee-lee7/Squire.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersAdministratorAppDataRoaming pm-cache_logs2021-05-24T03_13_25_959Z-debug.log

在网上找了跟多方法,比如删除这个路径下的日志信息C:UsersAdministratorAppDataRoaming pm-cache_logs,试了试,依旧报错

再比如删除npm-cache文件夹下的所有文件,结果依旧报错

报错信息显示和git有关,就安装了git,安装完之后,依旧报错,报错信息变为:
错误代码:128,

说明这个报错和git相关,又在网上翻阅资料,是开启了git证书的原因,在git控制台输入以下命令:git config --global http.sslverify "false",然而并没有解决问题,最终经过检查发现我是在桌面上打开的git窗口,没有在项目路径下打开窗口,这样肯定还报错

于是就在项目路径下打开git窗口,输入以下命令:git config --global http.sslverify "false",终于node_modules文件夹出现了,运行完之后,没有报错!!!赶紧npm run dev,项目运行成功了!

原文地址:https://www.cnblogs.com/8023s/p/14804287.html