Skip to content

Incompatible Node.js Version in Sanity CLI Installation #28

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
rohanvachheta opened this issue Mar 7, 2025 · 1 comment
Open

Incompatible Node.js Version in Sanity CLI Installation #28

rohanvachheta opened this issue Mar 7, 2025 · 1 comment

Comments

@rohanvachheta
Copy link

Issue Summary:
When attempting to install @sanity/cli globally using yarn global add @sanity/cli, the process fails due to an incompatible Node.js version.

Steps to Reproduce:

  1. Use a Dockerfile that includes the following line:
    RUN yarn global add @sanity/cli
    
  2. Run the Docker build process using Node.js 18.
  3. The build fails with the following error message:
    error @sanity/[email protected]: The engine "node" is incompatible with this module. Expected version ">=20.11.0". Got "18.20.7"
    
  4. The process exits with code 1, preventing the build from completing successfully.

Expected Behavior:
The @sanity/cli should be installed without errors when running yarn global add @sanity/cli.

Actual Behavior:
The installation fails due to an incompatible Node.js version requirement, as the installed Node.js version (18.20.7) does not meet the minimum required version (>=20.11.0).

Environment Details:

  • Node.js Version: 18.20.7
  • Sanity CLI Version: @sanity/[email protected]
  • Yarn Version: 1.22.22
  • Docker Base Image: node:18

Possible Solution:

  • Upgrade the Node.js version in the Dockerfile to meet the required version (>=20.11.0). Example:
    FROM node:20
  • Use nvm or similar tools to install and use a compatible Node.js version before installing @sanity/cli.

Additional Information:
This issue prevents automated builds and deployments relying on Docker and Sanity CLI. Updating the base image to Node.js 20 should resolve the compatibility issue.

Action Required:

  • Confirm the required Node.js version in Sanity's documentation.
  • Update dependencies or provide compatibility notes in the installation guides.
  • Consider a more descriptive error message guiding users on how to resolve the issue.
@itelnet44
Copy link

I'm also having the same issue.

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

2 participants