nuxt-modules / apollo

Nuxt.js module to use Vue-Apollo. The Apollo integration for GraphQL.
https://apollo.nuxtjs.org
MIT License
929 stars 194 forks source link

error @apollo/federation@0.27.0: The engine "node" is incompatible with this module. Expected version ">=12.13.0 <17.0". Got "18.16.0" #515

Open mbaah80 opened 1 year ago

mbaah80 commented 1 year ago

Environment

npx nuxi

Describe the bug

error @apollo/federation@0.27.0: The engine "node" is incompatible with this module. Expected version ">=12.13.0 <17.0". Got "18.16.0" when install @nuxtjs/apollo

Expected behaviour

should work with node version 18 and above since node 16 is coming to end of life

Reproduction

No response

Additional context

No response

Logs

No response

nicolasacerenza commented 11 months ago

Same issue here. Maybe updating the apollo CLI packate to Rover?

tkwong94 commented 11 months ago

Same issue. Is there any temporary solution?

manzoliric commented 11 months ago

same issue 😞

dorvidas commented 8 months ago

Same issue :(

nicolasacerenza commented 8 months ago

Got to solve it on my project.

In our case I updated all service graphql scripts and commands to use Codegen to download and also build. This was because apollo CLI library was deprecated and threw dependency errors related to apollo federation. Now we use Codegen for both schema download and typescript build. Commands were updated for yarn dev and build.

But of course this might vary for your project. My suggestion is investigating which dependency is using apollo federation and trying to change it for a Node 18 compatible one.

Let me know if I can help.

dorvidas commented 8 months ago

The way I fixed it is by using resolutions feature of Yarn, which allows forcing using specific version of indirect package. In the example below I force using 0.38.1 version which compatible with Node 18.

  "resolutions": {
    "@nuxtjs/apollo/**/@apollo/federation": "0.38.1"
  }

Also while looking for solution found out that doing yarn install --ignore-engines also installs succesfully. But we went for above solution.

Some helpfull yarn command yarn why @apollo/federation to figure which packages depends on this one.