npm install时出现以下问题
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! chromedriver@2.46.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the chromedriver@2.46.0 install script.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\andro\AppData\Roaming\npm-cache\_logs\2020-09-10T08_00_03_863Z-debug.log
PS D:\Project\vueworkspace\demo01> node install.js
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'D:\Project\vueworkspace\demo01\install.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
这是vue-cli的bug,解决办法是
npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver
再执行
npm i
网友评论