Error: @vitejs/plugin-vue requires vue (>=3.2.13) or @vue/compiler-sfc to be present in the dependen
Error: @vitejs/plugin-vue requires vue (>=3.2.13) or @vue/compiler-sfc to be present in the dependency tree.
ERROR Error: @vitejs/plugin-vue requires vue (>=3.2.13) or @vue/compiler-sfc to be present in the dependency tree.
Error: @vitejs/plugin-vue requires vue (>=3.2.13) or @vue/compiler-sfc to be present in the dependency tree.
at Object.<anonymous> (D:\vue_workspace\demo\node_modules\vue-loader\dist\compiler.js:14:15)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (D:\vue_workspace\demo\node_modules\vue-loader\dist\index.js:29:20)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! demo@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the demo@0.1.0 serve 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\13736\AppData\Roaming\npm-cache\_logs\2023-05-16T14_00_53_138Z-debug.log
解决方法:
project dependencies.
This error occurs when you are using the Vite.js plugin called “@vitejs/plugin-vue” but you have not installed the required dependencies. The plugin requires either “vue” version 3.2.13 or higher or “@vue/compiler-sfc” to be present in your project’s dependencies.
To resolve this error, you can install the required dependencies using npm or yarn. If you are using npm, you can run the following command:
Copy code
npm install vue@3.2.13 --save-dev
or
Copy code
npm install @vue/compiler-sfc --save-dev
If you are using yarn, you can run the following command:
Copy code
yarn add vue@3.2.13 --dev
or
Copy code
yarn add @vue/compiler-sfc --dev
After installing the required dependencies, you should be able to use the “@vitejs/plugin-vue” plugin without any errors.
更多推荐
所有评论(0)