1. 程式人生 > 實用技巧 >npm install 出現問題

npm install 出現問題

npm install 出現問題

第一種 [email protected] install: node install.js

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

該問題是vue-cli腳手架的一個bug,原因是chromedriver的部分檔案被國內網路給牆掉了,無法下載完整的chromedirver包,解決辦法:

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

原文連結

https://www.jianshu.com/p/38a3c1513fbe

第二種 ①卡住不動unexpected end of filecb() never called

一般情況下都是因為使用官方預設源,可以採用換源的方法

或者可以清除一下快取,

npm cache clean --force

並將原來的node_modules 資料夾刪除 重新npm install

還未整理完整,以後新增。