Watch a live product demo πŸ‘€ See how Sanity powers richer commerce experiences

Unable to Deploy to Netlify After Upgrade - npm ERR! code ERESOLVE

16 replies
Last updated: Jul 12, 2022
Hey people, I am having a weird issue. I can't deploy on netlify any longer, even though nothing has changed related to sanity. So I tried upgrading, and I am getting this error message:
Jul 11, 2022, 9:40 PM
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: sanity-eleventy-blog-studio@1.0.12
npm ERR! Found: @sanity/base@2.30.1
npm ERR! node_modules/@sanity/base
npm ERR!   @sanity/base@"^2.30.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @sanity/base@"^1" from sanity-plugin-dashboard-widget-document-list@0.0.11
npm ERR! node_modules/sanity-plugin-dashboard-widget-document-list
npm ERR!   sanity-plugin-dashboard-widget-document-list@"^0.0.11" from the root project
Jul 11, 2022, 9:40 PM
this is the exact same error message, that netlify gives me as well.
Jul 11, 2022, 9:40 PM
yet building it locally works just fine, on node 16 & node 17
Jul 11, 2022, 9:40 PM
I am thankful for any and all ideas
Jul 11, 2022, 9:41 PM
What does your
package.json
look like?
Jul 11, 2022, 9:42 PM
In root, it only has lerna as a dependency. I just ran
npm upgrade --legacy-peer-deps
, after that,
/studio
looks like this:
{
  "private": true,
  "name": "sanity-eleventy-blog-studio",
  "version": "1.0.12",
  "main": "package.json",
  "author": "Sanity <hello@sanity.io>",
  "scripts": {
    "dev": "sanity start",
    "format": "prettier-eslint --write \"**/*.js\" \"!node_modules/**\"",
    "build": "sanity build",
    "graphql-deploy": "sanity graphql deploy --playground",
    "lint": "eslint .",
    "test": "sanity check"
  },
  "dependencies": {
    "@sanity/base": "^2.30.1",
    "@sanity/cli": "^2.30.2",
    "@sanity/components": "^2.14.0",
    "@sanity/core": "^2.30.2",
    "@sanity/dashboard": "^2.30.1",
    "@sanity/default-layout": "^2.30.1",
    "@sanity/default-login": "^2.30.1",
    "@sanity/desk-tool": "^2.30.1",
    "date-fns": "^1.30.1",
    "prop-types": "^15.7.2",
    "react": "^16.14.0",
    "react-dom": "^16.14.0",
    "react-icons": "^3.11.0",
    "sanity-plugin-dashboard-widget-document-list": "^0.0.11",
    "sanity-plugin-dashboard-widget-netlify": "^1.0.1",
    "styled-components": "^5.3.5"
  },
  "devDependencies": {
    "babel-eslint": "^10.0.1",
    "eslint": "^5.16.0",
    "eslint-config-standard": "^12.0.0",
    "eslint-config-standard-react": "^7.0.2",
    "eslint-plugin-import": "^2.17.3",
    "eslint-plugin-node": "^9.1.0",
    "eslint-plugin-promise": "^4.1.1",
    "eslint-plugin-react": "^7.13.0",
    "eslint-plugin-standard": "^4.0.0",
    "prettier-eslint-cli": "^4.7.1"
  }
}
Jul 11, 2022, 9:43 PM
even after the upgrade, the error still persists
Jul 11, 2022, 10:07 PM
I honestly don't know what to do.
Jul 11, 2022, 10:27 PM
I'm at a loss here, too. I haven't come across this one before. I will keep looking though!
Jul 11, 2022, 10:28 PM
so... what is my course of action here then?
Jul 11, 2022, 10:38 PM
ask for help with netlify?
Jul 11, 2022, 10:38 PM
I literally can't even update the site
Jul 11, 2022, 10:38 PM
not saying someone needs to solve this, my client just literally cannot update their website any longer. Do I need to rebuild the entire website now?
Jul 11, 2022, 10:39 PM
No, you don't need to rebuild. You could try adding a
.npmrc
file with:
legacy-peer-deps=true
To force it through.
Jul 11, 2022, 10:44 PM
Could you please set npm 7 as your engine in your package.json and try again please?
  "engines": {
    "node": "16.x",
    "npm": "7"
  },
From version 8 onwards, npm is being aggressive with legacy peer dependencies, but npm 7 is fine with it.
Jul 12, 2022, 7:03 AM
Thank you
user F
&
user M
- that helped! It's building now. You saved my week πŸ™‚
Jul 12, 2022, 8:57 PM

Sanity– build remarkable experiences at scale

The Sanity Composable Content Cloud is the modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Related answers

Get more help in the community Slack

TopicCategoriesFeaturedRepliesLast Updated
After adding the subtitle and running this code npm run graphql-deploy It does nothingSep 15, 2020
how to limit a reference to just one entry in Studio reference input side versus the default as-many-entries-as-you-fill-in-an-array...Sep 18, 2020
Is it possible to fetch more than one "_type" using GROQ?Nov 2, 2020
I want to add a view with the Structure builder (S.view.component) where I list similar documents based on the title. What...Sep 23, 2020
Is there a structure builder example where the format of each preview for the document list is modified?Feb 3, 2021
I have an array of references to a country schema type but it always just returns NULL values for meJan 30, 2021
Hi, I need help with a query for getting the url of an image asset. Here is what I've been trying, but I only get the _ref...Dec 1, 2020
Sanity UI looks brilliant :smiley: Is something like the current date picker possible at the moment? I’m not sure if anicon...Dec 21, 2020
Hey everyone. I have been coding and may have potentially accidentally deleted something. Does anyone know how to resolve...Dec 26, 2020
Hello everyone and happy new year :raised_hands::skin-tone-2:, I have a problem with outputting Portable Text :disappointed:...Jan 1, 2021

Related contributions

Clean Next.js + Sanity app
- Template

Official(made by Sanity team)

A clean example of Next.js with embedded Sanity ready for recomposition.

Cody Olsen
Go to Clean Next.js + Sanity app

Blog with Built-in Content Editing
- Template

Official(made by Sanity team)

A Sanity-powered blog with built-in content editing and instant previews.

Go to Blog with Built-in Content Editing