زوہیب خان
زوہیب خان

Reputation: 452

Unable to install vue-property-decorator or vue-class-component, when created project using vite

I have created a Vue3 project using Vite. When Vite is used I am unable to install vue-property-decorator or vue-class-component. It says it is unable to resolve dependency tree. Errors are attached below:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: new-vite-project@0.0.0
npm ERR! Found: vue@3.2.32
npm ERR! node_modules/vue
npm ERR!   vue@"^3.2.25" from the root project
npm ERR!   peer vue@"*" from vue-property-decorator@9.1.2
npm ERR!   node_modules/vue-property-decorator
npm ERR!     vue-property-decorator@"*" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"^2.0.0" from vue-class-component@7.2.6
npm ERR! node_modules/vue-class-component
npm ERR!   peer vue-class-component@"*" from vue-property-decorator@9.1.2
npm ERR!   node_modules/vue-property-decorator
npm ERR!     vue-property-decorator@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/zohaib/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/zohaib/.npm/_logs/2022-04-13T20_02_35_956Z-debug.log

Upvotes: 1

Views: 4697

Answers (1)

Kapcash
Kapcash

Reputation: 6919

vue-class-component still doesn't officially support Vue 3.
It has a Release Candidate (RC) version though, but it may not be ready for production.

See this comment: vue-class-component issue #406

To install it:

npm install [email protected] [email protected]

Upvotes: 4

Related Questions