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

created at 07-10-2021 views: 1

description

npm install webpack webpack-cli webpack-dev-server

package.json script configuration:

script: {
  "start" : "webpack-dev-server"
}

Error when executing code npm run start

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

My version number is as follows:

 version number

solution

  1. Many solutions on the Internet are webpack-cli downgrade processing, which I did before
  2. But here I would share another solution today:
    Change the script configuration package.json to the following:
script: {
  "start" : "webpack server"
}

then Just execute npm run start again and it will be OK.

Please log in to leave a comment.