To resolve the error @vitejs/plugin-vue requires vue (>=3.2.13) or @vue/compiler-sfc to be present in the dependency tree.
, you need to ensure that either Vue version 3.2.13 or later is installed or the @vue/compiler-sfc
package is included in your project’s dependencies.
Here’s an example of how you can update your project to fix this error:
- Open your project’s
package.json
file. - Check the version of Vue listed in the
dependencies
ordevDependencies
section. Make sure it meets the requirement of being equal to or greater than version 3.2.13. If not, update the Vue package to the required version. For example:{ "dependencies": { "vue": "^3.2.13" } }
- If your project already has an older version of Vue installed, run the following command in your project’s root directory to update Vue:
npm install vue@^3.2.13
or if you’re using Yarn:
yarn add vue@^3.2.13
- If you’re already using Vue version 3.2.13 or later, check if the
@vue/compiler-sfc
package is present in your project’s dependencies. If not, add it as a dependency using the following command:npm install @vue/compiler-sfc
or with Yarn:
yarn add @vue/compiler-sfc
- Once the necessary changes are made, restart your development server and the error should be resolved.
By ensuring that Vue version 3.2.13 or later is installed and the @vue/compiler-sfc
package is included, you should be able to use the @vitejs/plugin-vue
without any issues.
Read more interesting post
- Devtools inspection is not available because it’s in production mode or
- Error in dev.off() : cannot shut down device 1 (the null device)
- Required request body is missing
- Using `archs` setting to build architectures of target `pods-runner`: (“)
[!] unable to find a target named `runnertests` in project