[webpack-cli] Error: Cannot find module ‘vue/compiler-sfc‘
An error is reported when webpack packages Vue files
[webpack-cli] Error: Cannot find module 'vue/compiler-sfc'
The reason is that I use vue2, but the version is wrong. The following is the corresponding version
Vue 3 requires Vue-loader V16 + @Vue/compiler-sfc
Vue 2 requires vue-loader v15 + vue-template-compiler.
Solution: downgrade to version 15
$ cnpm i vue-loader@15 -D
Read More:
- [Solved] Error: Cannot find module ‘vue-template-compiler/package.json‘ Require stack:
- The vue3 project Error: Cannot find module’vue-loader-v16/package.json’
- When starting Vue project: cannot find module ‘webpack cli/bin/config yargs’ error resolution
- [Solved] Vue Project Error: Error: Cannot find module ‘webpack‘ Require stack以及Error: Rule can only have one resource so
- [Solved] Error: Cannot find module ‘@vue/cli-shared-utils‘
- [Solved] Error: Cannot find module ‘@vue/cli-shared-utils
- [Solved] Vue package error: Syntax Error: Error: Cannot find module ‘mozjpeg’
- [Solved] Module build failed: Error: Vue packages version mismatch
- Vue project Run Error: Syntax Error: Error: Cannot find module ‘less‘
- [Solved] Syntax Error: Error: Cannot find module ‘@vue/babel-preset-app‘
- [Solved] Vue Install loader Error: Syntax Error: Error: Cannot find module ‘less‘
- [Solved] Vue Route Error: Uncaught TypeError: (0 , vue__WEBPACK_IMPORTED_MODULE_42__.defineComponent) is not a function
- [Solved] Vue Error: Module build failed Error Node Sass version 6.0.1 is incompatible with ^4.0.0.
- Error: Cannot find module ‘./application‘ [How to Solve]
- [Solved] Error: Cannot find module ‘@/views/xxx‘ at webpackEmptyContext
- [Solved] Vue calls style loader error: Module build failed: CssSyntaxError
- Module build failed: Error: Couldn’t find preset “es2015” relative to directory
- Vue Start Error: This relative module was not found:
- [Solved] ERROR Error: Cannot find module ‘vue-loader-v16/package.json‘
- Node.js Error: Error: Cannot find module ‘express‘ [How to Solve]