webpack-dev-server 不能正常启动
> webpack-dev-server
internal/modules/cjs/loader.js:796
throw err;
^
Error: Cannot find module 'webpack/bin/config-yargs'
Require stack:
我本来的版本是这个
npm run dev命令后 不能正常启动,网经的个个问题指向版本兼容不行
把配置改成 “dev”: “webpack serve --mode development”
原因:升级后webpack-dev-server与 webpack-cli不能正常兼容,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack serve --mode development"
},
我是看了这老哥的博客
https://blog.csdn.net/Gemini_Kanon/article/details/114368812.