Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not upgrade project to Vue 3.2.1 #576

Open
1 task done
ntgraph opened this issue Aug 10, 2021 · 23 comments
Open
1 task done

Can not upgrade project to Vue 3.2.1 #576

ntgraph opened this issue Aug 10, 2021 · 23 comments

Comments

@ntgraph
Copy link

ntgraph commented Aug 10, 2021

  • 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

@techouse
Copy link

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
Copy link
Member

Justineo commented Sep 4, 2021

Can you privide the complete log output for the error?

@hydroid7
Copy link

Just install the Vue Composition Lib with the following command:

yarn add @vue/composition-api

@Justineo
Copy link
Member

Does the issue still exist?

@Zefau
Copy link

Zefau commented Jan 24, 2022

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
Copy link
Member

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

@Zefau
Copy link

Zefau commented Jan 25, 2022

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

@techouse
Copy link

techouse commented Feb 13, 2022

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

@djtuBIG-MaliceX
Copy link

djtuBIG-MaliceX commented Apr 28, 2022

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
Copy link
Member

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
Copy link

This is still an ongoing problem

MrCube42 added a commit to MrCube42/vue-echarts that referenced this issue Nov 25, 2022
@Justineo
Copy link
Member

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

@notesjor
Copy link

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
Copy link

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
Copy link

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

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
Copy link

jinyukk commented Jun 14, 2023

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
Copy link
Member

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:

vue-echarts/package.json

Lines 76 to 80 in 53ebc29

"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
}
},

...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
Copy link

would be nice if this was fixed.

@Justineo
Copy link
Member

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

@rafalh
Copy link

rafalh commented Jan 3, 2024

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
Copy link
Member

Justineo commented Jan 3, 2024

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
Copy link

rafalh commented Jan 3, 2024

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests