
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeGood news that you found a solution! For anyone else encountering this Error [ERR_REQUIRE_ESM]: require() of ES Module string-width from cliui not supported error when running sanity graphql deploy, this is typically a Node.js version compatibility issue with the Sanity CLI and its dependencies.
The error occurs because some dependencies in the Sanity CLI toolchain have moved to ES modules, which can cause conflicts with certain Node.js versions. Here are the solutions that typically work:
Primary Solution:
node_modules folder and lock file (package-lock.json, yarn.lock, or pnpm-lock.yaml)npm install (or your package manager of choice)sanity graphql deploy againImportant Context:
As mentioned in the GraphQL deployment documentation, the GraphQL endpoint is not automatically deployed when you deploy your studio. You need to run sanity graphql deploy manually, and you'll need to re-deploy it every time you update your Sanity schema (not just content changes).
Additional Notes:
--dry-run to validate your API before deploying--no-playground if you want to disable itIf upgrading Node.js doesn't resolve the issue, double-check that your package.json has "type": "module" if you're using ES modules throughout your project, or ensure consistency in how you're importing/requiring modules across your configuration files.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store