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 webpack@^4.0.0 --save-dev
Read More:
- [Solved] Vue Use gzip Package Error: Rule can only have one resource source
- Error: Rule can only have one resource source (provided resource and test + include + exclude)
- [Solved] Vue Error: Error: Rule can only have one resource source (provided resource and test + include + ex
- [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
- [Solved] Error: Cannot find module ‘vue-template-compiler/package.json‘ Require stack:
- The vue3 project Error: Cannot find module’vue-loader-v16/package.json’
- [Solved] Vue Route Error: Uncaught TypeError: (0 , vue__WEBPACK_IMPORTED_MODULE_42__.defineComponent) is not a function
- [Solved] Vue Start Project Error: ValidationError: webpack Dev Server Invalid Options
- Vue project Run Error: Syntax Error: Error: Cannot find module ‘less‘
- [Solved] webpack Package Error: ERROR in multi ./src/main.js ./dist/bundle.js Module not found: Error: Can‘t resolv
- [webpack-cli] Error: Cannot find module ‘vue/compiler-sfc‘
- [Solved] Vue Project Error: error ‘v-model‘ directives require no argument vue/valid-v-model
- “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.
- [Solved] Vue Less error: Webpack project report expected indentation of 0 spaces but found 2
- [Solved] gyp ERR! stack Error: Could not find any Python installation to use
- Error: Cannot find module ‘./application‘ [How to Solve]
- [Solved] Error: Cannot find module ‘@vue/cli-shared-utils
- Vue init webpack Error: unable to verify the first certificate