The following error occurred while running NPM Run Dev:
Error: Cannot find module 'webpack/bin/config-yargs'
Require stack:
- D:\javaProject\vue\myvue\node_modules\webpack-dev-server\bin\webpack-dev-server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Module.require (internal/modules/cjs/loader.js:1042:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (D:\javaProject\vue\myvue\node_modules\webpack-dev-server\bin\webpack-dev-server.js:54:1)
at Module._compile (internal/modules/cjs/loader.js:1156:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'D:\\javaProject\\vue\\myvue\\node_modules\\webpack-dev-server\\bin\\webpack-dev-server.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Wenxindiao\AppData\Roaming\npm-cache\_logs\2020-04-22T03_06_48_257Z-debug.log
Solution:
this is because the current version of [email protected] does not support [email protected]. So simply delete the current Webpack-dev-Server folder and reinstall the higher version. The steps are as follows:
- find the project folder you created, mine is D:\javaProject\vue\myvue\node_modules\webpack-dev-server, delete the webpack-dev-server folder. Run NPM I [email protected] in the current project directory, and your webpack-dev-server version will be fine. Or update directly to the latest version
npm i –-save-dev webpack-dev-server@next
div>
Read More:
- Error: solution to the problem of cannot find module ‘webpack / bin / config yargs’
- Solved – problem cannot find module ‘webpack / bin / config yargs’
- Cannot find module ‘webpack cli / bin / config yargs‘
- When starting Vue project: cannot find module ‘webpack cli/bin/config yargs’ error [How to Fix]
- VUE Error: Cannot find module ‘webpack/bin/config-yargs’
- NPM run dev error: cannot find module ‘webpack cli / bin / config yargs‘
- NPX webpack cannot find module’html webpack plugin’a bug causes headache
- Error: Cannot find Module ‘Webpack-cli ‘- Solution
- [Solved] Error: Cannot find module ‘webpack/lib/RequestShortener’
- Run webpack error: Error: Cannot find module’webpack/lib/node/NodeTemplatePlugin’
- Error: Cannot find module ‘webpack/schemas/WebpackOptions.json’
- Solution to prompt “cannot find module ‘eslint config defaults / configurations / eslint’” when submitting with Git
- Has HTML webpack plugin been installed, or error: cannot find module ‘HTML webpack plugin’
- Error: cannot find module ‘webpack / lib / ruleset’_ solve
- NPM can’t find D: //nodejs/node all of The solution of sudden_modules/NPM/bin/npm-cli.js
- Webpack error module build failed: typeerror: fileSystem.statSync is not a function
- Error: Cannot find module ‘process-nextick-args’
- node.js Cannot find module “XXX” solution
- Error reported after moving or copying Vue items: cannot find module ‘xxx‘
- NPM error ‘cannot find module’ internal / util / types’ solution;