Issue with unsupported engine in Gridsome project resolved by removing engine options in package.json.
I can see you're hitting an npm engine compatibility issue with the sanity-gridsome package. The error message is a bit confusing because it says you need npm ^6.10.0 but you have npm 8.1.0, which should actually satisfy that requirement. However, the issue is likely related to how Lerna (the monorepo tool) is handling engine checks in the root package.
Here are a few solutions to try:
Option 1: Use the --legacy-peer-deps flag
npm install --legacy-peer-depsThis tells npm to bypass strict peer dependency and engine checks, which should allow the installation to proceed.
Option 2: Downgrade npm temporarily
Since the package specifically mentions npm ^6.10.0, you could try using npm 6.x:
npm install -g npm@6.14.15Then run your npm install again in the project root. You can always upgrade npm back to v8 afterward.
Option 3: Use the --force flag
npm install --forceThis will override the engine check entirely.
Option 4: Install in individual directories
Since you mentioned the web/ and studio/ folders work individually, you could:
cd web && npm installcd ../studio && npm install- Skip the root-level install if it's only used for Lerna orchestration
About the underlying issue:
You're right that there was likely a recent update to the Sanity Gridsome source plugin. The sanity-gridsome package in the root is probably a Lerna helper package with overly strict engine requirements that don't account for newer npm versions.
It's worth noting that Gridsome's development has slowed considerably in recent years, and the Vue.js ecosystem has largely moved toward frameworks like Nuxt for static site generation. If you're starting a new project, you might want to consider using Nuxt 3 with Sanity instead, as it has more active development and better long-term support.
Let me know which solution works for you!
Sanity – Build the way you think, not the way your CMS thinks
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.