Skip to content

Update the node version mention in tutorial/from-zero-to-federation-in-5-steps-using-cosmo from ">= 20 LTS" to ">= 22.11.0 LTS" #64

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

Open
raosudheesh opened this issue May 8, 2025 · 0 comments · May be fixed by #66

Comments

@raosudheesh
Copy link

raosudheesh commented May 8, 2025

Title:

Update the Node.js version mentioned in tutorial/from-zero-to-federation-in-5-steps-using-cosmo from ">= 20 LTS" to ">= 22.11.0 LTS"

Description:

While following the tutorial from-zero-to-federation-in-5-steps-using-cosmo, when running the command:

wgc router compose --input graph.localhost.yaml --out config.json

I encountered following error:

➜  cosmo-demo git:(main) ✗ nvm use 20.9.0                
Now using node v20.9.0 (npm v10.1.0)


➜  cosmo-demo git:(main) ✗ cd router


➜  router git:(main) ✗ wgc router compose --input graph.localhost.yaml --out config.json


Error:

file:///home/sudheesh/.nvm/versions/node/v20.9.0/lib/node_modules/wgc/dist/src/core/config.js:5
import info from '../../package.json' with { type: 'json' };
                                    ^^^^
SyntaxError: Unexpected token 'with'
  at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:118:18)
  at callTranslator (node:internal/modules/esm/loader:273:14)
  at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:30)


Node.js v20.9.0

I was initially using Node.js v20.9.0 LTS, which satisfies the currently documented requirement of >= 20 LTS. However, this version caused the above command to fail due to compatibility issues. The issue was resolved after upgrading to Node.js v22.11.0 LTS.

Additionally, upon further investigation, I noticed that the main cosmo repo (wundergraph/cosmo) explicitly declares the following in its package.json:

  "engines": {
    "node": ">=22.11.0",
    "pnpm": "9"
  },

This further confirms that Node.js v22.11.0 is the actual minimum version required for proper functionality.

Proposed Fix:

Update the Node.js requirement in the tutorial documentation to reflect the actual minimum version:

Current: >= 20 LTS

Proposed: >= 22.11.0 LTS

This clarification will help avoid confusion and prevent runtime errors for users following the guide.

Context:

I encountered this issue while setting up the related project: wundergraph/cosmo-demo. I’ll be raising a PR to update the documentation accordingly.

raosudheesh pushed a commit to raosudheesh/cosmo-docs that referenced this issue May 8, 2025
…-federation-in-5-steps-using-cosmo docs from >=20 to >=20.11.0
@raosudheesh raosudheesh changed the title Update the node version mention in tutorial/from-zero-to-federation-in-5-steps-using-cosmo from ">= 20 LTS" to ">= 20.11.0 LTS" Update the node version mention in tutorial/from-zero-to-federation-in-5-steps-using-cosmo from ">= 20 LTS" to ">= 22.11.0 LTS" May 8, 2025
raosudheesh pushed a commit to raosudheesh/cosmo-docs that referenced this issue May 8, 2025
…-federation-in-5-steps-using-cosmo docs from >=20 to >=22.11.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment