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

The engine "node" is incompatible with this module #216

Closed
ghost opened this issue Oct 9, 2020 · 13 comments
Closed

The engine "node" is incompatible with this module #216

ghost opened this issue Oct 9, 2020 · 13 comments

Comments

@ghost
Copy link

ghost commented Oct 9, 2020

when trying to install @apollo/gateway with yarn, I have the following error:

error @apollo/[email protected]: The engine "node" is incompatible with this module. Expected version ">=12.13.0 <15.0". Got "10.22.1"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

@trevor-scheer
Copy link
Member

This is as expected. Node 12 has been in LTS for nearly a year now, and we depend on some of its features. As such do not support node versions <12.13.0 as the error suggests. You'll have to update your version of node in order to run the gateway.

@aim97
Copy link

aim97 commented Feb 13, 2022

Will you support higher versions of node, i'm getting the same message now using version "v16.13.2".

@yarapolana
Copy link

Getting the same error using node 18.9.1 on a deployment environment, can't change it there.

@trevor-scheer
Copy link
Member

Current versions of the gateway (2.x) allow ">=12.13.0" without an upper limit anymore, so this shouldn't be an issue going forward.
https://github.com/apollographql/federation/blob/main/gateway-js/package.json#L21

@lanternlogic
Copy link

lanternlogic commented Dec 12, 2023

I get a similar issue for @apollo/federation when i try to yarn install on even just node v18, ie:
error @apollo/[email protected]: The engine "node" is incompatible with this module. Expected version ">=12.13.0 <17.0". Got "18.18.2"
despite my project certainly not using @apollo/federation anywhere... any idea how to fix this?
I am running:
"@apollo/server": "^4.9.5"

@trevor-scheer
Copy link
Member

@lanternlogic what's the output of yarn why @apollo/federation? Something in your project is depending on it.

@lanternlogic
Copy link

lanternlogic commented Dec 13, 2023

@trevor-scheer I actually figured it out.. was depended on by an old package in another workspace within my project... i didnt know yarn install in one workspace checks deps in other workspaces!

@shtefanilie
Copy link

@trevor-scheer I am seeing the same issue on my end, whilst trying to use node 18.
It seems it's part of apollo and in turn apollo-language-server.
I've updated apollo to version 2.34.0, but it seems the federation package is still at version 27.

I do see this package is deprecated https://www.npmjs.com/package/@apollo/federation

Here is the output for yarn why

[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "@apollo/[email protected]"
info Reasons this module exists
   - "_project_#PROJECT_NAME#apollo#apollo-language-server" depends on it
   - Hoisted from "_project_#PROJECT_NAME#apollo#apollo-language-server#@apollo#federation"
info Disk size without dependencies: "1.72MB"
info Disk size with unique dependencies: "2.22MB"
info Disk size with transitive dependencies: "16.46MB"
info Number of shared dependencies: 7
✨  Done in 10.17s.

@lanternlogic
Copy link

@shtefanilie you should update to the latest Apollo v4.x

@shtefanilie
Copy link

@shtefanilie you should update to the latest Apollo v4.x

@lanternlogic I think you're confusing apollo-toolkit with @apollo/client. And even in that case, both of them don't have v4.x

@jwarykowski
Copy link

Hey @shtefanilie, this was originally reported here: apollographql/apollo-tooling#2675

You can get around this problem by setting a dependency resolution.

"overrides": {
  "@apollo/federation": "0.38.1"
}

Its not super ideal but either way you should look at migrating to https://the-guild.dev/graphql/codegen as apollo codegen:generate is deprecated.

@ibmitw
Copy link

ibmitw commented Jan 17, 2024

I have same problem. How to remove or migrate @apollo/[email protected] ? I can't migrate to node v18 because this problem.

@lanternlogic
Copy link

lanternlogic commented Jan 17, 2024

@ibmitw try running yarn why @apollo/federation to see where it's coming from, and then remove that package.
It turned out for me that another yarn workspace within the project was referencing @apollo/federation. That package I wasn't using anymore anyway, so I removed it and made it work.

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

7 participants