NPM run build packaging source code is incompatible with multiple versions of webpack, and an error is reported
Then use NPM run build to package the source code, and there is a webpack error, and then the prompt message of NPM audit fix is as follows
su@ly050:~/Downloads/dingtalk$ npm audit fix
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/webpack
npm ERR! peer webpack@"4.x.x || 5.x.x" from @webpack-cli/[email protected]
npm ERR! node_modules/@webpack-cli/configtest
npm ERR! @webpack-cli/configtest@"^1.1.0" from [email protected]
npm ERR! node_modules/webpack-cli
npm ERR! dev webpack-cli@"^4.9.1" from the root project
npm ERR! 3 more (@webpack-cli/configtest, @webpack-cli/info, @webpack-cli/serve)
npm ERR! peer webpack@">=2" from [email protected]
npm ERR! node_modules/babel-loader
npm ERR! dev babel-loader@"^8.1.0" from the root project
npm ERR! 13 more (clean-webpack-plugin, eslint-loader, file-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^4.27.0 || ^5.0.0" from [email protected]
npm ERR! node_modules/css-loader
npm ERR! dev css-loader@"^4.2.1" from the root project
npm ERR! peer css-loader@"*" from [email protected]
npm ERR! node_modules/vue-loader
npm ERR! dev vue-loader@"^15.9.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/webpack
npm ERR! peer webpack@"^4.27.0 || ^5.0.0" from [email protected]
npm ERR! node_modules/css-loader
npm ERR! dev css-loader@"^4.2.1" from the root project
npm ERR! peer css-loader@"*" from [email protected]
npm ERR! node_modules/vue-loader
npm ERR! dev vue-loader@"^15.9.3" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/su/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/su/.npm/_logs/2021-11-01T01_35_04_547Z-debug.log
My approach is to uninstall the current webpack and then reassign a global version.
sudo npm uninstall webpack
sudo npm install [email protected] -g
Read More:
- NPM and Node.js Version incompatibility
- NPX webpack cannot find module’html webpack plugin’a bug causes headache
- Webpack Upgrade Error: webpack.NamedModulesPlugin is not a constructor
- Run webpack error: Error: Cannot find module’webpack/lib/node/NodeTemplatePlugin’
- Webpack error module build failed: typeerror: fileSystem.statSync is not a function
- Has HTML webpack plugin been installed, or error: cannot find module ‘HTML webpack plugin’
- Error: can’t resolve ‘FS’ in (webpack 2 configures CSS loaders)
- Error: Cannot find module’webpack/bin/config-yargs’ solution
- Using webpack to report typeerror: this.getresolve is not a function
- This version of chromedriver only supports chrome version 92 crawler simulates the problem of Google plug-in version when the browser clicks and reports an error
- Warning when using numpy: runtimewarning: numpy.dtype size changed, may indicate binary incompatibility
- Webpack — module build failed: error: the node API for ‘Babel’ has been moved to Babel core
- Solved – problem cannot find module ‘webpack / bin / config yargs’
- Error: Cannot find module ‘webpack/schemas/WebpackOptions.json’
- Multi environment configuration of springboot under docker
- How to Fix webpack Module build failed Error: The node API for ‘babel’ has been moved to babel-core
- 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‘
- Webpack encountered a variety of problems to solve
- RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd