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"即可,修改后的如下图:

package.json
package.json

发表回复