1. 程式人生 > >Vue搭建環境時npm run dev,npm ERR! code ELIFECYCLE

Vue搭建環境時npm run dev,npm ERR! code ELIFECYCLE

報錯如下

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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!     C:\Users\admin\AppData\Roaming\npm-cache\_logs\2018-11-09T07_28_28_466Z-debug.log

解決:解除安裝已安裝的新版本webpack,裝老版本就好。如果沒有安裝webpack,跳過第一條命令安裝一下就好了。

(1)依次輸入以下命令

npm uninstall webpack-dev-server

(2)安裝2.9.1的webpack

npm install 
[email protected]

(3)執行專案

npm run dev

 如果您的問題沒有解決,還望大哥留言告訴小弟~