Reputation: 13
I'm on Next.js and can't resolve this issue.
I don't find any opened issue in their GitHub.
{
"dependencies": {
"@apollo/client": "^3.7.1",
"@types/apollo-upload-client": "^17.0.2",
"@types/node": "18.11.9",
"@types/react": "18.0.25",
"@types/react-dom": "18.0.9",
"axios": "^1.1.3",
"eslint": "8.27.0",
"eslint-config-next": "13.0.4",
"form-data": "^4.0.0",
"graphql": "^16.6.0",
"next": "13.0.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"styled-components": "^5.3.6",
"typescript": "4.9.3"
}
}
Upvotes: 1
Views: 5547
Reputation: 13
The engine "node" is incompatible with this module. Expected version "^18.15.0 || >=20.4.0". Got "16.20.2"
I upgrade the node
version and this error went away
Upvotes: 0
Reputation: 216
I think this error is more of a version thing. I face the same issue with apollo-upload-client version 18.x.x
. I needed to revert back to version 17.0.5 and everything worked. I hope apollo provides a more detailed documentation as to how to handle this in version 18.x.x
Upvotes: 0
Reputation: 91
I had the same problem, I made sure I installed both
"apollo-upload-client": "^18.0.1",
"@types/apollo-upload-client": "^17.0.5",
also make sure you follow the Requirements in npm
But what really worked for me is replacing the adding createUploadLink.mjs to the import, like so
import createUploadLink from "apollo-upload-client/createUploadLink.mjs";
then create the client
const httpLink = createUploadLink({
uri: "http://localhost:4000/graphql", // Replace with your GraphQL endpoint
});
Upvotes: 9