test-utils icon indicating copy to clipboard operation
test-utils copied to clipboard

Confilcts with @nuxt/test-utils and Nuxt3

Open Chocopieca opened this issue 1 year ago โ€ข 3 comments

Environment

  • Operating System: Windows_NT
  • Node Version: v21.7.3
  • Nuxt Version: ^3.11.2
  • CLI Version: 3.13.1
  • Nitro Version: -
  • Package Manager: npm
  • Builder: - vite
  • User Config: compatibilityDate, devtools, modules, i18n
  • Runtime Modules: @pinia/nuxt@^0.5.1, @nuxt/test-utils/module@^3.13.1, @nuxt/devtools@^1.3.1, @nuxtjs/robots@^3.0.0, @nuxtjs/tailwindcss@^6.12.0, @nuxtjs/eslint-module@^4.1.0, @nuxtjs/i18n@^8.3.1, @vite-pwa/nuxt@^0.7.0, nuxt-clarity-analytics@^0.0.6, @nuxt/image@^1.7.0
  • Build Modules: -

Reproduction

Here is reproduce, just try to install dependances. @nuxt-test-utils-dependaces-error.zip

Describe the bug

npm i catch npm ERR! ERESOLVE could not resolve

Additional context

I reinstalled dependancy and caught error.

Logs

PS C:\reproduce\nuxt-autocomplit-type-error> npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: nuxt-app@undefined
npm ERR! Found: [email protected]
npm ERR! node_modules/vue
npm ERR!   peer vue@"^3.3.4" from @nuxt/[email protected]
npm ERR!   node_modules/@nuxt/test-utils
npm ERR!     dev @nuxt/test-utils@"^3.13.1" from the root project
npm ERR!   peer vue@"^3.2.0" from [email protected]
npm ERR!   node_modules/vue-router
npm ERR!     vue-router@"^4.3.2" from the root project
npm ERR!     peer vue-router@"^4.0.0" from @nuxt/[email protected]
npm ERR!     node_modules/@nuxt/test-utils
npm ERR!       dev @nuxt/test-utils@"^3.13.1" from the root project
npm ERR!     1 more (@nuxtjs/i18n)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev @pinia/testing@"^0.1.3" 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.4.0" from [email protected]
npm ERR!     node_modules/pinia
npm ERR!       pinia@"^2.1.7" from the root project
npm ERR!       1 more (@pinia/testing)
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!
npm ERR! For a full report see:
npm ERR! C:\Users\AppData\Local\npm-cache\_logs\2024-08-29T22_11_47_097Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: C:\Users\AppData\Local\npm-cache\_logs\2024-08-29T22_11_47_097Z-debug-0.log

Chocopieca avatar Aug 29 '24 22:08 Chocopieca

Hey @Chocopieca! ๐Ÿ‘‹ I'm here to help you with any issues you're facing. I'm a bot that can assist with bug fixes, answer questions, and guide you on how to become a contributor. Let's tackle this challenge together!

I found some similar issues and discussions that might be relevant to your problem:

  1. Pinia installation error [1]
  2. Error with install nuxt [2]
  3. Nuxt install fails with nuxt/kit error [3]

To resolve the ERESOLVE dependency conflict when installing @nuxt/test-utils with Nuxt3, you can use the --legacy-peer-deps flag with your package manager. This flag tells the package manager to ignore peer dependency conflicts and proceed with the installation.

Here is the command you can use with npm:

npm install @nuxt/test-utils --legacy-peer-deps

If you are using yarn, you can use:

yarn add @nuxt/test-utils --ignore-engines

For pnpm, you can use:

pnpm add @nuxt/test-utils --legacy-peer-deps

This should help you bypass the dependency conflict and install @nuxt/test-utils successfully [4].

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Aug 29 '24 22:08 dosubot[bot]

npm install @nuxt/test-utils --legacy-peer-deps Helped me

Chocopieca avatar Sep 02 '24 13:09 Chocopieca

hi guys, any plans to bump dependencies to resolve this? ๐Ÿ™Œ

halws avatar Sep 05 '24 10:09 halws

The issue here is coming from pinia and will be resolved in v3 of pinia.

danielroe avatar Dec 04 '24 16:12 danielroe