webpack报错2
webpack-dev-server后重新打包时报错
报错代码:
npm ERR! errno 1
npm ERR! mywebpack@1.0.0 dev: webpack-dev-server
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mywebpack@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\lenovo\AppData\Roaming\npm-cache_logs\2021-04-08T11_45_27_657Z-debug.log
报错信息:
解决:
查阅资料发现是webpack与webpack-cli的版本不和,需要重新安装一个其他版本的webpack-cli,这里采用
npm i webpack-cli@3.3.12 -D
安装3.3.12版本的webpack-cli,之后可以成功打包了。