apollo icon indicating copy to clipboard operation
apollo copied to clipboard

error @apollo/[email protected]: The engine "node" is incompatible with this module. Expected version ">=12.13.0 <17.0". Got "18.16.0"

Open mbaah80 opened this issue 2 years ago • 6 comments

Environment

npx nuxi

Describe the bug

error @apollo/[email protected]: 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

mbaah80 avatar Jun 19 '23 18:06 mbaah80

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

nicolasacerenza avatar Jul 08 '23 21:07 nicolasacerenza

Same issue. Is there any temporary solution?

tkwong94 avatar Jul 25 '23 09:07 tkwong94

same issue 😞

manzoliric avatar Aug 01 '23 14:08 manzoliric

Same issue :(

dorvidas avatar Oct 11 '23 17:10 dorvidas

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.

nicolasacerenza avatar Oct 11 '23 17:10 nicolasacerenza

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.

dorvidas avatar Oct 13 '23 12:10 dorvidas