Error 1: NPM run serve reports an error when Vue project is started: error: cannot find module ‘webpack’ require stack
After the project is pulled down and the dependencies are installed normally, start the project and report error: cannot find module ‘webpack’ require stack. It is found that the webpack module is missing,
Error: Cannot find module 'webpack'
Require stack:
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
However, I have already installed webpack. Here, I need to re open CMD to install webpack globally
reason:
even if you installed webpack before, it must be a non global installation
Solution:
npm install -g webpack
After the installation is complete, I start the project and find that it reports an error again!
Reported error: Error: Rule can only have one resource source (provided resource and test + include + exclude) in
Error 2: Project Error: Error: Rule can only have one resource source (provided resource and test + include + exclude) in
Error: Rule can only have one resource source (provided resource and test + include + exclude) in {
"exclude": [
null
]
reason:
package. Webpack version conflict in JSON
Solution::
delete the webpack and reinstall the previous version
npm uninstall webpack
npm install [email protected]^4.0.0 --save-dev
Read More:
- Error: Rule can only have one resource source (provided resource and test + include + exclude)
- [Solved] Vue Use gzip Package Error: Rule can only have one resource source
- [Solved] Error Rule can only have one resource source (provided resource and test + include + exclude)
- [Solved] Error Rule can only have one resource source (provided resource and test + include + exclude)
- When starting Vue project: cannot find module ‘webpack cli/bin/config yargs’ error resolution
- ‘webpack dev server’ is not an internal or external command, nor is it a runnable program or batch file. Solution: error in cnpm run dev:
- Node.js Error: Error: Cannot find module ‘express‘ [How to Solve]
- [Solved] Vue Error: Error: Rule can only have one resource source (provided resource and test + include + ex
- Error: Cannot find module ‘./application‘ [How to Solve]
- “Failed to load resource: net::ERR_FILE_NOT_FOUND” error. The project created by vue-cli 3.0 can run under dev, and an error is reported after packaging, and the page is blank.
- Vue Install less Error: While resolving: [email protected]
- Module not found: Error: Can‘t resolve ‘core-js/modules/es.promise.js‘ in
- React: How to Solve Web3 import error
- Cannot read property ‘isFile‘ of undefined [How to Solve]
- [Solved] Webpack compile error: SyntaxError: Unexpected token =
- [Solved] npm Error: Class extends value undefined is not a constructor or null
- [Solved] Error: Cannot find module ‘@/views/xxx‘ at webpackEmptyContext
- [Solved] Node.js v17 npm run dev Error: opensslErrorStack
- Vue scaffold creation project and run error [Solved]
- Vue Package Image Error: Syntax Error: Error: ‘**\node_modules\pngquant-bin\vendor\pngquant.exe‘