Error: Cannot find module ‘webpack-cli/bin/config-yargs’

Webpack打包用webpack-dev-server配置DevServer后打包报错:

Error: Cannot find module 'webpack-cli/bin/config-yargs'

的package.json中的"dev": "webpack-dev-server --open"改为"dev": "webpack serve --open"即可,修改后的如下图:

Error: Cannot find module ‘webpack-cli/bin/config-yargs’插图
Error: Cannot find module ‘webpack-cli/bin/config-yargs’插图1 package.json

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注