Error: solution to the problem of cannot find module ‘webpack / bin / config yargs’

In terminal use of VSCode, using NPM run dev causes an error

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

It is possible that the webpack-dev-server version number is too low
The solution
Uninstall webpack-dev-server globally first

npm uninstall webpack-dev-server -g

Then install the latest version

npm install [email protected]


Read More: