github-action-sanity icon indicating copy to clipboard operation
github-action-sanity copied to clipboard

Incompatible Node.js Version in Sanity CLI Installation

Open rohanvachheta opened this issue 9 months ago • 1 comments

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.

rohanvachheta avatar Mar 07 '25 11:03 rohanvachheta

I'm also having the same issue.

itelnet44 avatar Mar 09 '25 18:03 itelnet44

Following up on this. Would be nice to update this. The action is not working at this point. 😊

eivindml avatar Jun 11 '25 07:06 eivindml

released in v0.8-alpha

bobinska-dev avatar Aug 15 '25 08:08 bobinska-dev