npm ERR! chromedriver@2.43.1 install: `node install.js`

http://www.itdecent.cn/p/38a3c1513fbe

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! chromedriver@2.43.1 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the chromedriver@2.43.1 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!     /Users/zyb/.npm/_logs/2019-02-19T07_45_25_225Z-debug.log

該問題是vue-cli腳手架的一個bug,原因是chromedriver的部分文件被國內(nèi)網(wǎng)絡給墻掉了,無法下載完整的chromedirver包,解決辦法:

sudo npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver
sudo npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver

Password:

> chromedriver@2.46.0 install /Users/zyb/Desktop/attend/node_modules/chromedriver
> node install.js

/Users/zyb/Desktop/attend/node_modules/chromedriver/2.46/chromedriver is not writable: EACCES: permission denied, mkdir '/Users/zyb/Desktop/attend/node_modules/chromedriver/2.46'
/Users/zyb/Desktop/attend/node_modules/chromedriver/2.46/chromedriver is not writable: EACCES: permission denied, mkdir '/Users/zyb/Desktop/attend/node_modules/chromedriver/2.46'
Current existing ChromeDriver binary is unavailable, proceding with download and extraction.
Downloading from file:  http://cdn.npm.taobao.org/dist/chromedriver/2.46/chromedriver_mac64.zip
Saving to file: /tmp/2.46/chromedriver/chromedriver_mac64.zip
Received 781K...
Received 1564K...
Received 2351K...
Received 3132K...
Received 3918K...
Received 4700K...
Received 5483K...
Received 6264K...
Received 6891K total.
Extracting zip contents
Copying to target path /Users/zyb/Desktop/attend/node_modules/chromedriver/lib/chromedriver
Fixing file permissions
Done. ChromeDriver binary available at /Users/zyb/Desktop/attend/node_modules/chromedriver/lib/chromedriver/chromedriver
npm WARN The package babel-preset-es2015 is included as both a dev and production dependency.

+ chromedriver@2.46.0
added 11 packages from 10 contributors and audited 13790 packages in 39.12s
found 9 vulnerabilities (2 low, 1 moderate, 5 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

我的項目中是以及裝好了node-sass的,如果直接裝chromedriver會報報node-sass沒有安裝的錯誤

sudo npm installl node-sass -S
?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容