ecomfe / vue-echarts

Vue.js component for Apache ECharts™.
https://vue-echarts.dev
MIT License
9.48k stars 1.48k forks source link

Can not upgrade project to Vue 3.2.1 #576

Closed ntgraph closed 16 hours ago

ntgraph commented 2 years ago

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

techouse commented 2 years ago

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
Justineo commented 2 years ago

Can you privide the complete log output for the error?

hydroid7 commented 2 years ago

Just install the Vue Composition Lib with the following command:

yarn add @vue/composition-api
Justineo commented 2 years ago

Does the issue still exist?

Zefau commented 2 years ago

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.

Justineo commented 2 years ago

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

Zefau commented 2 years ago

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

techouse commented 2 years ago

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

djtuBIG-MaliceX commented 2 years ago

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

Justineo commented 2 years ago

I still cannot reproduce this with npm@8:

➜  ve-test ls
index.html   package.json
➜  ve-test npm ls
ve-test@1.0.0 /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
ve-test@1.0.0 /Users/justineo/dev/ve-test
├── echarts@5.3.2
├── vue-echarts@6.0.2
└── vue@3.2.33

➜  ve-test
brunoalod commented 1 year ago

This is still an ongoing problem

Justineo commented 1 year ago

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

notesjor commented 1 year ago

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: vue@3.2.47 npm ERR! node_modules/vue npm ERR! peer vue@"^3.2.47" from @nuxt/vite-builder@3.2.0 npm ERR! node_modules/@nuxt/vite-builder npm ERR! @nuxt/vite-builder@"3.2.0" from nuxt@3.2.0 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/vue@1.0.21 npm ERR! node_modules/@unhead/vue npm ERR! @unhead/vue@"^1.0.21" from @vueuse/head@1.0.25 npm ERR! node_modules/@vueuse/head npm ERR! @vueuse/head@"^1.0.25" from nuxt@3.2.0 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: vue@2.6.14 npm ERR! node_modules/vue npm ERR! peer vue@">= 2.5 < 2.7" from @vue/composition-api@1.7.1 npm ERR! node_modules/@vue/composition-api npm ERR! peerOptional @vue/composition-api@"^1.0.5" from vue-echarts@6.5.4 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: vue@3.2.47 node_modules/vue peer vue@"^3.2.47" from @nuxt/vite-builder@3.2.0 node_modules/@nuxt/vite-builder @nuxt/vite-builder@"3.2.0" from nuxt@3.2.0 node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@">=2.7 || >=3" from @unhead/vue@1.0.21 node_modules/@unhead/vue @unhead/vue@"^1.0.21" from @vueuse/head@1.0.25 node_modules/@vueuse/head @vueuse/head@"^1.0.25" from nuxt@3.2.0 node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.2.25" from @vitejs/plugin-vue@4.0.0 node_modules/@vitejs/plugin-vue @vitejs/plugin-vue@"^4.0.0" from @nuxt/vite-builder@3.2.0 node_modules/@nuxt/vite-builder @nuxt/vite-builder@"3.2.0" from nuxt@3.2.0 node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.0.0" from @vitejs/plugin-vue-jsx@3.0.0 node_modules/@vitejs/plugin-vue-jsx @vitejs/plugin-vue-jsx@"^3.0.0" from @nuxt/vite-builder@3.2.0 node_modules/@nuxt/vite-builder @nuxt/vite-builder@"3.2.0" from nuxt@3.2.0 node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"3.2.47" from @vue/server-renderer@3.2.47 node_modules/@vue/server-renderer @vue/server-renderer@"3.2.47" from vue@3.2.47 peer vue@"^3.0.0" from @vuetify/loader-shared@1.7.1 node_modules/@vuetify/loader-shared @vuetify/loader-shared@"^1.7.1" from vite-plugin-vuetify@1.0.2 node_modules/vite-plugin-vuetify peerOptional vite-plugin-vuetify@"^1.0.0-alpha.12" from vuetify@3.1.4 node_modules/vuetify peer vuetify@"^3.0.0-beta.4" from @vuetify/loader-shared@1.7.1 peer vuetify@"^3.0.0-beta.4" from vite-plugin-vuetify@1.0.2 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/head@1.0.25 node_modules/@vueuse/head @vueuse/head@"^1.0.25" from nuxt@3.2.0 node_modules/nuxt dev nuxt@"^3.1.2" from the root project vue@"^3.2.47" from nuxt@3.2.0 node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.2.0" from vue-router@4.1.6 node_modules/vue-router vue-router@"^4.1.6" from nuxt@3.2.0 node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.2.0" from vuetify@3.1.4 node_modules/vuetify peer vuetify@"^3.0.0-beta.4" from @vuetify/loader-shared@1.7.1 peer vuetify@"^3.0.0-beta.4" from vite-plugin-vuetify@1.0.2 dev vuetify@"^3.1.4" from the root project

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

Conflicting peer dependency: vue@2.6.14 node_modules/vue peer vue@">= 2.5 < 2.7" from @vue/composition-api@1.7.1 node_modules/@vue/composition-api peerOptional @vue/composition-api@"^1.0.5" from vue-echarts@6.5.4 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

muffinhydra commented 1 year ago

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.

luisaugs commented 1 year ago

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: vue@3.2.47 npm ERR! node_modules/vue npm ERR! peer vue@"^3.2.47" from @nuxt/vite-builder@3.2.0 npm ERR! node_modules/@nuxt/vite-builder npm ERR! @nuxt/vite-builder@"3.2.0" from nuxt@3.2.0 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/vue@1.0.21 npm ERR! node_modules/@unhead/vue npm ERR! @unhead/vue@"^1.0.21" from @vueuse/head@1.0.25 npm ERR! node_modules/@vueuse/head npm ERR! @vueuse/head@"^1.0.25" from nuxt@3.2.0 npm ERR! nodemodules/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: vue@2.6.14 npm ERR! node_modules/vue npm ERR! peer vue@">= 2.5 < 2.7" from @vue/composition-api@1.7.1 npm ERR! node_modules/@vue/composition-api npm ERR! peerOptional @vue/composition-api@"^1.0.5" from vue-echarts@6.5.4 npm ERR! nodemodules/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: vue@3.2.47 node_modules/vue peer vue@"^3.2.47" from @nuxt/vite-builder@3.2.0 node_modules/@nuxt/vite-builder @nuxt/vite-builder@"3.2.0" from nuxt@3.2.0 node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@">=2.7 || >=3" from @unhead/vue@1.0.21 node_modules/@unhead/vue @unhead/vue@"^1.0.21" from @vueuse/head@1.0.25 node_modules/@vueuse/head @vueuse/head@"^1.0.25" from nuxt@3.2.0 node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.2.25" from @vitejs/plugin-vue@4.0.0 node_modules/@vitejs/plugin-vue @vitejs/plugin-vue@"^4.0.0" from @nuxt/vite-builder@3.2.0 node_modules/@nuxt/vite-builder @nuxt/vite-builder@"3.2.0" from nuxt@3.2.0 node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.0.0" from @vitejs/plugin-vue-jsx@3.0.0 node_modules/@vitejs/plugin-vue-jsx @vitejs/plugin-vue-jsx@"^3.0.0" from @nuxt/vite-builder@3.2.0 node_modules/@nuxt/vite-builder @nuxt/vite-builder@"3.2.0" from nuxt@3.2.0 node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"3.2.47" from @vue/server-renderer@3.2.47 node_modules/@vue/server-renderer @vue/server-renderer@"3.2.47" from vue@3.2.47 peer vue@"^3.0.0" from @vuetify/loader-shared@1.7.1 node_modules/@vuetify/loader-shared @vuetify/loader-shared@"^1.7.1" from vite-plugin-vuetify@1.0.2 node_modules/vite-plugin-vuetify peerOptional vite-plugin-vuetify@"^1.0.0-alpha.12" from vuetify@3.1.4 node_modules/vuetify peer vuetify@"^3.0.0-beta.4" from @vuetify/loader-shared@1.7.1 peer vuetify@"^3.0.0-beta.4" from vite-plugin-vuetify@1.0.2 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/head@1.0.25 node_modules/@vueuse/head @vueuse/head@"^1.0.25" from nuxt@3.2.0 node_modules/nuxt dev nuxt@"^3.1.2" from the root project vue@"^3.2.47" from nuxt@3.2.0 node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.2.0" from vue-router@4.1.6 node_modules/vue-router vue-router@"^4.1.6" from nuxt@3.2.0 node_modules/nuxt dev nuxt@"^3.1.2" from the root project peer vue@"^3.2.0" from vuetify@3.1.4 node_modules/vuetify peer vuetify@"^3.0.0-beta.4" from @vuetify/loader-shared@1.7.1 peer vuetify@"^3.0.0-beta.4" from vite-plugin-vuetify@1.0.2 dev vuetify@"^3.1.4" from the root project

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

Conflicting peer dependency: vue@2.6.14 node_modules/vue peer vue@">= 2.5 < 2.7" from @vue/composition-api@1.7.1 node_modules/@vue/composition-api peerOptional @vue/composition-api@"^1.0.5" from vue-echarts@6.5.4 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

jinyukk commented 1 year ago

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

Justineo commented 1 year ago

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

jpengelbrecht commented 1 year ago

would be nice if this was fixed.

Justineo commented 1 year ago

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

rafalh commented 6 months ago

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?

Justineo commented 6 months ago

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?

rafalh commented 6 months ago

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?

bahmanian commented 1 month ago

I gave this error during installation using command "npm i echarts vue-echarts": While resolving: undefined@undefined Found: vue@3.4.27 node_modules/vue dev vue@"^3.4.7" from the root project

Could not resolve dependency: peer vue@">= 2.5 < 2.7" from @vue/composition-api@1.7.2 node_modules/@vue/composition-api @vue/composition-api@"*" 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.