vue-echarts: Can not upgrade project to Vue 3.2.1

  • I can confirm this problem is not reproducible with ECharts itself.

How are you introducing Vue-ECharts into your project?

ES Module imports

Versions

├─┬ @vue/cli-plugin-babel@4.5.13
│ └─┬ @vue/babel-preset-app@4.5.13
│   └── vue@3.1.1 deduped
├─┬ @vue/compiler-sfc@3.1.1
│ └── vue@3.1.1 deduped
├── echarts@5.1.2
├─┬ element-plus@1.0.2-beta.48
│ └── vue@3.1.1 deduped
├─┬ vue-axios@3.2.4
│ └── vue@3.1.1 deduped
├─┬ vue-draggable-next@2.0.1
│ └── vue@3.1.1 deduped
├─┬ vue-echarts@6.0.0-rc.6
│ ├── echarts@5.1.2 deduped
│ ├─┬ vue-demi@0.9.1
│ │ └── vue@3.1.1 deduped
│ └── vue@3.1.1 deduped
├─┬ vue-i18n@9.1.6
│ └── vue@3.1.1 deduped
├─┬ vue-router@4.0.9
│ └── vue@3.1.1 deduped
├── vue@3.1.1
└─┬ vuex@4.0.2
  └── vue@3.1.1 deduped

Details

I have a projet running all versions described about. Everything runs ok. If I want to upgrade Vue to a newer version, I run npm update. It seems a package @vue\composition-api block the update.
Can you assist

Reproduction

https://codesandbox.io/s/charming-night-2y6m6?file=/package.json

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 2
  • Comments: 22 (8 by maintainers)

Commits related to this issue

Most upvoted comments

The npm resolution error shows that the conflict is from @vue/compisiton-api marking vue@">= 2.5 < 2.7" as its peer dep. But in fact @vue/composition-api itself is marked as an optional peer dep of vue-echarts and not used by Vue 3 projects:

https://github.com/ecomfe/vue-echarts/blob/53ebc2941ea39cddd4181efc30331ad06ed315e7/package.json#L76-L80

…but npm doesn’t seem to respect this. As vue-echarts supports both Vue 2 and Vue 3 so that @vue/composition-api cannot be completely removed from peer deps.

Does it work with npm if we enable the --legacy-peer-deps flag (as the error log suggests)?

Error still exists for me. I forked this repo and removed line https://github.com/ecomfe/vue-echarts/blob/main/package.json#L60. This removes the peer dependency “@vue/composition-api”, which is not required for Vue 3.

Same here.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! vue-echarts@"^6.0.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @vue/composition-api@1.1.1
npm ERR! node_modules/@vue/composition-api
npm ERR!   peerOptional @vue/composition-api@"^1.0.5" from vue-echarts@6.0.0
npm ERR!   node_modules/vue-echarts
npm ERR!     vue-echarts@"^6.0.0" from the root project