1. The question is:
module.js:538
throw err;
^
Error: Cannot find module 'webpack/bin/config-yargs'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (D:\saic\dev\expressVue\node_modules\[email protected]@webpack-dev-server\bin\webpack-dev-server.js:54:1)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
Reason 2.
The above error occurs when webpack does not match the webpack-dev-server version. The specific version is as follows:
“Webpack” : “^ 4.35.0,”
“webpack – cli” : “^ 3.3.5”,
“webpack – dev – server” : “^ 2.11.5”
Webpack-dev-server should be used in pairs with Webpack, with versions 2.2.0 to 3.0.0 for 2.11.5 of Webpack.
Webpack is version 4.35.0 in this project, which is ahead of webpack-dev-server, so you should upgrade webpack-dev-server.
3. Solutions
3.1 Uninstall the old package and then upgrade
cnpm uninstall --save-dev webpack-dev-server
cnpm install --save-dev [email protected]
It is also possible to replace CNPM with NPM.
3.2 Modify package.json and then CNPM install or NPM install
The method for root 3.1 is essentially the same
Read More:
- Error: solution to the problem of cannot find module ‘webpack / bin / config yargs’
- Error: Cannot find module’webpack/bin/config-yargs’ solution
- Cannot find module ‘webpack cli / bin / config yargs‘
- When starting Vue project: cannot find module ‘webpack cli/bin/config yargs’ error [How to Fix]
- NPM run dev error: cannot find module ‘webpack cli / bin / config yargs‘
- VUE Error: Cannot find module ‘webpack/bin/config-yargs’
- NPX webpack cannot find module’html webpack plugin’a bug causes headache
- Run webpack error: Error: Cannot find module’webpack/lib/node/NodeTemplatePlugin’
- [Solved] Error: Cannot find module ‘webpack/lib/RequestShortener’
- Error: Cannot find module ‘webpack/schemas/WebpackOptions.json’
- Has HTML webpack plugin been installed, or error: cannot find module ‘HTML webpack plugin’
- Error: cannot find module ‘webpack / lib / ruleset’_ solve
- Error: Cannot find Module ‘Webpack-cli ‘- Solution
- Solution to prompt “cannot find module ‘eslint config defaults / configurations / eslint’” when submitting with Git
- Perfectly solve the problem of NPM start error: cannot find module ‘XX’
- Python’s importerror: DLL load failed: the specified module was not found and the problem was solved
- Webpack error module build failed: typeerror: fileSystem.statSync is not a function
- Webpack Upgrade Error: webpack.NamedModulesPlugin is not a constructor
- Error: Cannot find module ‘process-nextick-args’
- The MAC system installs MySQL client, and the error is solved_ config not found