目录
一、问题描述
vue项目运行dev,之前没有问题,但是今天直接报错如下
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\...\AppData\Roaming\npm-cache\_logs\2022-09-29T11_00_16_550Z-debug.log
二、问题原因
webpack-dev-server版本和vue版本不一样,需要将webpack-dev-server卸载了,安装对应版本
三、解决方法
1.查看vue版本是 2.9.6
vue -V
注意:-V是大写,小写是会报错
2.卸载
npm uninstall webpack-dev-server
3.安装
npm i [email protected]
4.安装
npm install webpack cli -D
5.正常启动。
npm run dev
标签:npm,ERR,--,dev,server,webpack
From: https://www.cnblogs.com/raybresline/p/16865348.html