npm ERR! chromedriver@2.27.2 install: `node install.js`
1.错误
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! chromedriver@2.27.2 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the chromedriver@2.27.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2022-10-17T07_15_10_948Z-debug.log
2.解决方案
2.1Nodejs版本降级
卸载原先安装的Nodejs,下载12.几的版本
Nodejs历史版本下载
2.2手动下载安装chromedriver
下载地址
先删除项目中node_modules文件夹
在vscode终端下,先执行以下命令,安装chromedriver
npm install chromedriver --chromedriver_filepath =自己电脑下载chromedriver的路径\chromedriver_win32.zip
例如:
npm install chromedriver --chromedriver_filepath=E:\JavaProject\chromedriver_win32.zip
安装完再执行以下命令即可
npm install
启动项目
npm run dev
版权声明:本文为qq_45498432原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。