Tag Archives: Cannot findmodule’webpack-cli/bin/config-yargs

Cannot findmodule’webpack-cli/bin/config-yargs

Cannot find module’webpack-cli/bin/config-yargs

$ yarn start
yarn run v1.22.10
$ webpack-dev-server --hot --config build/webpack.dev.js
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'webpack-cli/bin/config-yargs'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/Users/xxx/vue_demo/node_modules/webpack-dev-server/bin/webpack-dev-server.js:65:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The version is as follows:

...
"webpack-cli": "^4.0.0",
"webpack-dev-server": "^3.11.0",

Solution:

...
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0",
...