When starting Vue project: cannot find module ‘webpack cli / bin / config yargs’ error resolution

An error is reported when starting Vue project: cannot find module ‘webpack cli/bin/config yargs’, as shown in the following figure:

the reason for this error is that the version of webpack and webpack dev server is incompatible. The solution is as follows:

Under this vue project, type:
npm uninstall webpack -g
npm uninstall -g webpack-dev-server
Uninstall and reinstall:
npm install [email protected] --save-dev
npm install [email protected] --save-dev

Restart the project, success!


Read More: