Vue項目報錯:npm ERR! code ELIFECYCLE npm ERR! errno 126


運行vue項目報如下錯誤:

npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! todos@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the todos@1.0.0 dev 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/lijie/.npm/_logs/2020-05-10T13_50_02_149Z-debug.log

原因:可能是由於node_modules模塊中缺失或者某些東西沖突引起的,我們可以使用如下的方法解決這個問題:

在項目下依次輸入以下命令:先移除原項目的node_modules模塊和package-lock.json,再強制清除緩存,然后重新安裝,

rm -rf node_modules
rm package-lock.json
npm cache clear --force
npm install

最后運行項目,完美解決。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM