vue项目初始化时npm run dev报错webpack-dev-server

不完美00 发表于 2019-05-27 10:16:55

标签: vue, webpack-dev-server

- +

在运行vue项目时报如下问题:

E:\mobile_real\mobile-vue>npm run dev


> mobile_real@1.0.0 dev E:\mobile_real\mobile-vue

> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js


npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! mobile_real@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the mobile_real@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!     C:\Users\FKT00120\AppData\Roaming\npm-cache\_logs\2019-05-27T01_45_54_024Z-debug.log

查阅资料发现是webpack新版bug,卸载现有webpack,安装老版本即可

解决办法:

1、npm uninstall webpack-dev-server

2、npm install webpack-dev-server@2.9.1

3、npm run dev


possitive(2) negative(0) views640 comments1
私信 收藏 分享
分享到

发送私信

最新评论

不完美00 2019-05-27 18:25:53

这个问题解决办法有两种,还有一种是升级webpack为v4+,不过升级之后会要求安装更多的依赖,遇到相应问题可以参阅:https://github.com/mzgoddard/jest-webpack/issues/27;


请先 登录 再评论.
相关文章