vue-echarts icon indicating copy to clipboard operation
vue-echarts copied to clipboard

Can not upgrade project to Vue 3.2.1

Open ntgraph opened this issue 2 years ago • 22 comments

  • [X] 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/[email protected]
│ └─┬ @vue/[email protected]
│   └── [email protected] deduped
├─┬ @vue/[email protected]
│ └── [email protected] deduped
├── [email protected]
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ ├── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├── [email protected]
└─┬ [email protected]
  └── [email protected] 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

ntgraph avatar Aug 10 '21 21:08 ntgraph

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/[email protected]
npm ERR! node_modules/@vue/composition-api
npm ERR!   peerOptional @vue/composition-api@"^1.0.5" from [email protected]
npm ERR!   node_modules/vue-echarts
npm ERR!     vue-echarts@"^6.0.0" from the root project

techouse avatar Aug 16 '21 08:08 techouse

Can you privide the complete log output for the error?

Justineo avatar Sep 04 '21 15:09 Justineo

Just install the Vue Composition Lib with the following command:

yarn add @vue/composition-api

hydroid7 avatar Oct 25 '21 09:10 hydroid7

Does the issue still exist?

Justineo avatar Jan 19 '22 11:01 Justineo

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.

Zefau avatar Jan 24 '22 20:01 Zefau

It is marked as an optional peer deps, are you still using npm@6 which may not recognize the peerDependenciesMeta field?

Justineo avatar Jan 25 '22 02:01 Justineo

No I'm on latest npm. Works with yarn though.

Zefau avatar Jan 25 '22 06:01 Zefau

Yea, still causing issues with npm v8.3.1, works with yarn though.

techouse avatar Feb 13 '22 22:02 techouse

Any update on this issue? Nuxt 3 is currently on RC and will be cementing the need for working Vue3 support. See: https://v3.nuxtjs.org/bridge/bridge-composition-api

djtuBIG-MaliceX avatar Apr 28 '22 05:04 djtuBIG-MaliceX

I still cannot reproduce this with npm@8:

➜  ve-test ls
index.html   package.json
➜  ve-test npm ls
[email protected] /Users/justineo/dev/ve-test
└── (empty)

➜  ve-test npm -v
8.7.0
➜  ve-test npm i -D vue echarts vue-echarts

added 27 packages, and audited 28 packages in 5s

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
➜  ve-test npm ls
[email protected] /Users/justineo/dev/ve-test
├── [email protected]
├── [email protected]
└── [email protected]

➜  ve-test

Justineo avatar Apr 28 '22 06:04 Justineo

This is still an ongoing problem

brunoalod avatar Nov 07 '22 19:11 brunoalod

Is this still a problem? Can you provide a repo that can reproduce this issue?

Justineo avatar Jan 29 '23 01:01 Justineo

npm install echarts - works fine if I try to install vue-echarts npm install vue-echarts I get this error-stack:

CONSOLE

npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: undefined@undefined npm ERR! Found: [email protected] npm ERR! node_modules/vue npm ERR! peer vue@"^3.2.47" from @nuxt/[email protected] npm ERR! node_modules/@nuxt/vite-builder npm ERR! @nuxt/vite-builder@"3.2.0" from [email protected] npm ERR! node_modules/nuxt npm ERR! dev nuxt@"^3.1.2" from the root project npm ERR! peer vue@">=2.7 || >=3" from @unhead/[email protected] npm ERR! node_modules/@unhead/vue npm ERR! @unhead/vue@"^1.0.21" from @vueuse/[email protected] npm ERR! node_modules/@vueuse/head npm ERR! @vueuse/head@"^1.0.25" from [email protected] npm ERR! node_modules/nuxt npm ERR! dev nuxt@"^3.1.2" from the root project npm ERR! 8 more (@vitejs/plugin-vue, @vitejs/plugin-vue-jsx, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! vue-echarts@"" from the root project npm ERR! npm ERR! Conflicting peer dependency: [email protected] npm ERR! node_modules/vue npm ERR! peer vue@">= 2.5 < 2.7" from @vue/[email protected] npm ERR! node_modules/@vue/composition-api npm ERR! peerOptional @vue/composition-api@"^1.0.5" from [email protected] npm ERR! node_modules/vue-echarts npm ERR! vue-echarts@"" 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.

LOG-FILE:

npm resolution error report

While resolving: undefined@undefined Found: [email protected] node_modules/vue peer vue@"^3.2.47" from @nuxt/[email protected] node_modules/@nuxt/vite-builder @nuxt/vite-builder@"3.2.0" from [email protected] node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@">=2.7 || >=3" from @unhead/[email protected] node_modules/@unhead/vue @unhead/vue@"^1.0.21" from @vueuse/[email protected] node_modules/@vueuse/head @vueuse/head@"^1.0.25" from [email protected] node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.2.25" from @vitejs/[email protected] node_modules/@vitejs/plugin-vue @vitejs/plugin-vue@"^4.0.0" from @nuxt/[email protected] node_modules/@nuxt/vite-builder @nuxt/vite-builder@"3.2.0" from [email protected] node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.0.0" from @vitejs/[email protected] node_modules/@vitejs/plugin-vue-jsx @vitejs/plugin-vue-jsx@"^3.0.0" from @nuxt/[email protected] node_modules/@nuxt/vite-builder @nuxt/vite-builder@"3.2.0" from [email protected] node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"3.2.47" from @vue/[email protected] node_modules/@vue/server-renderer @vue/server-renderer@"3.2.47" from [email protected] peer vue@"^3.0.0" from @vuetify/[email protected] node_modules/@vuetify/loader-shared @vuetify/loader-shared@"^1.7.1" from [email protected] node_modules/vite-plugin-vuetify peerOptional vite-plugin-vuetify@"^1.0.0-alpha.12" from [email protected] node_modules/vuetify peer vuetify@"^3.0.0-beta.4" from @vuetify/[email protected] peer vuetify@"^3.0.0-beta.4" from [email protected] dev vuetify@"^3.1.4" from the root project dev vite-plugin-vuetify@"^1.0.2" from the root project peer vue@">=2.7 || >=3" from @vueuse/[email protected] node_modules/@vueuse/head @vueuse/head@"^1.0.25" from [email protected] node_modules/nuxt dev nuxt@"^3.1.2" from the root project vue@"^3.2.47" from [email protected] node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.2.0" from [email protected] node_modules/vue-router vue-router@"^4.1.6" from [email protected] node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.2.0" from [email protected] node_modules/vuetify peer vuetify@"^3.0.0-beta.4" from @vuetify/[email protected] peer vuetify@"^3.0.0-beta.4" from [email protected] dev vuetify@"^3.1.4" from the root project

Could not resolve dependency: vue-echarts@"*" from the root project

Conflicting peer dependency: [email protected] node_modules/vue peer vue@">= 2.5 < 2.7" from @vue/[email protected] node_modules/@vue/composition-api peerOptional @vue/composition-api@"^1.0.5" from [email protected] node_modules/vue-echarts vue-echarts@"*" from the root project

Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.

This ist a minimal project solution. Techstack: Nuxt3 + Vuetify3

Nuxt3Base.zip

notesjor avatar Feb 10 '23 10:02 notesjor

I had the same problem. Updating from npm 7.24.2 to npm 9.5.1 solved this issue for me. My stack is also Nuxt3 and Vuetify3.

muffinhydra avatar Mar 01 '23 11:03 muffinhydra

npm install echarts - works fine if I try to install vue-echarts npm install vue-echarts I get this error-stack:

CONSOLE

npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: undefined@undefined npm ERR! Found: [email protected] npm ERR! node_modules/vue npm ERR! peer vue@"^3.2.47" from @nuxt/[email protected] npm ERR! node_modules/@nuxt/vite-builder npm ERR! @nuxt/vite-builder@"3.2.0" from [email protected] npm ERR! node_modules/nuxt npm ERR! dev nuxt@"^3.1.2" from the root project npm ERR! peer vue@">=2.7 || >=3" from @unhead/[email protected] npm ERR! node_modules/@unhead/vue npm ERR! @unhead/vue@"^1.0.21" from @vueuse/[email protected] npm ERR! node_modules/@vueuse/head npm ERR! @vueuse/head@"^1.0.25" from [email protected] npm ERR! node_modules/nuxt npm ERR! dev nuxt@"^3.1.2" from the root project npm ERR! 8 more (@vitejs/plugin-vue, @vitejs/plugin-vue-jsx, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! vue-echarts@"" from the root project npm ERR! npm ERR! Conflicting peer dependency: [email protected] npm ERR! node_modules/vue npm ERR! peer vue@">= 2.5 < 2.7" from @vue/[email protected] npm ERR! node_modules/@vue/composition-api npm ERR! peerOptional @vue/composition-api@"^1.0.5" from [email protected] npm ERR! node_modules/vue-echarts npm ERR! vue-echarts@"" 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.

LOG-FILE:

npm resolution error report

While resolving: undefined@undefined Found: [email protected] node_modules/vue peer vue@"^3.2.47" from @nuxt/[email protected] node_modules/@nuxt/vite-builder @nuxt/vite-builder@"3.2.0" from [email protected] node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@">=2.7 || >=3" from @unhead/[email protected] node_modules/@unhead/vue @unhead/vue@"^1.0.21" from @vueuse/[email protected] node_modules/@vueuse/head @vueuse/head@"^1.0.25" from [email protected] node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.2.25" from @vitejs/[email protected] node_modules/@vitejs/plugin-vue @vitejs/plugin-vue@"^4.0.0" from @nuxt/[email protected] node_modules/@nuxt/vite-builder @nuxt/vite-builder@"3.2.0" from [email protected] node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.0.0" from @vitejs/[email protected] node_modules/@vitejs/plugin-vue-jsx @vitejs/plugin-vue-jsx@"^3.0.0" from @nuxt/[email protected] node_modules/@nuxt/vite-builder @nuxt/vite-builder@"3.2.0" from [email protected] node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"3.2.47" from @vue/[email protected] node_modules/@vue/server-renderer @vue/server-renderer@"3.2.47" from [email protected] peer vue@"^3.0.0" from @vuetify/[email protected] node_modules/@vuetify/loader-shared @vuetify/loader-shared@"^1.7.1" from [email protected] node_modules/vite-plugin-vuetify peerOptional vite-plugin-vuetify@"^1.0.0-alpha.12" from [email protected] node_modules/vuetify peer vuetify@"^3.0.0-beta.4" from @vuetify/[email protected] peer vuetify@"^3.0.0-beta.4" from [email protected] dev vuetify@"^3.1.4" from the root project dev vite-plugin-vuetify@"^1.0.2" from the root project peer vue@">=2.7 || >=3" from @vueuse/[email protected] node_modules/@vueuse/head @vueuse/head@"^1.0.25" from [email protected] node_modules/nuxt dev nuxt@"^3.1.2" from the root project vue@"^3.2.47" from [email protected] node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.2.0" from [email protected] node_modules/vue-router vue-router@"^4.1.6" from [email protected] node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.2.0" from [email protected] node_modules/vuetify peer vuetify@"^3.0.0-beta.4" from @vuetify/[email protected] peer vuetify@"^3.0.0-beta.4" from [email protected] dev vuetify@"^3.1.4" from the root project

Could not resolve dependency: vue-echarts@"*" from the root project

Conflicting peer dependency: [email protected] node_modules/vue peer vue@">= 2.5 < 2.7" from @vue/[email protected] node_modules/@vue/composition-api peerOptional @vue/composition-api@"^1.0.5" from [email protected] node_modules/vue-echarts vue-echarts@"*" from the root project

Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.

This ist a minimal project solution. Techstack: Nuxt3 + Vuetify3

Nuxt3Base.zip

Same issue. echarts install fine, but vue-echarts throw this error

node v: 16.5.0 npm v: 8.9.0 vue v: 3.2.25

luisaugs avatar Apr 18 '23 12:04 luisaugs

When I add vue-echarts to my Nuxt3 project by npm install vue-echarts, it failed and had same problem. And then I use pnpm install vue-echarts, it succeeded.

I hope this helpes.

My Environment: node version: 18.15.0 npm version: 9.6.3 Nuxt version: 3.5.2

jinyukk avatar Jun 14 '23 03:06 jinyukk

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)?

Justineo avatar Jun 14 '23 05:06 Justineo

would be nice if this was fixed.

jpengelbrecht avatar Jul 12 '23 10:07 jpengelbrecht

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

Justineo avatar Jul 13 '23 04:07 Justineo

I have the same problem with npm 10.2.3. Adding --legacy-peer-deps resolves the problem but I would prefer if it was fixed upstream... Maybe having a separate version for Vue 2 would be a solution?

rafalh avatar Jan 03 '24 15:01 rafalh

I have the same problem with npm 10.2.3.

I still cannot reproduce with npm 10.2.3. Can you elaborate on how to reproduce this error in a fresh project?

Justineo avatar Jan 03 '24 16:01 Justineo

Can you elaborate on how to reproduce this error in a fresh project?

Not really which surprises me. I get this error in existing project. I stripped down package.json as much as I could and you can find the result here: reproduction.zip Running npm install vue-echarts triggers the error. But if I remove lock file and node_module, optionally change the version specifier for vue to 3.3.10 (so it is the same as in the removed lock file) and then install from scratch the error does not happen. If I just change "vue": "^3.3.10" to "vue": "3.3.10" without removing anything the error also does not trigger. I feel my knowledge of npm and peer dependencies is too low to debug it further. Maybe it's not a bug of vue-echarts but a bug of npm?

rafalh avatar Jan 03 '24 18:01 rafalh