Error: Cannot find module ‘webpack-cli/bin/config-yargs‘ code: ‘MODULE_NOT_FOUND‘,

Problem description: The
error message is shown in the figure: When
learning webpack-dev-server automatic packaging, I keep reporting errors and don’t understand why.
Insert picture description here
Problem solving:
Insert picture description here
Uninstall the current version of webpack-cli and download 3. * version to match 5.* version of webpack. Will report an error.
npm uninstall webpack-cli
npm install webpack-cli@3 -D

Guess you like

Origin blog.csdn.net/qq_38192709/article/details/113885913