Unable to Deploy to Netlify After Upgrade - npm ERR! code ERESOLVE
16 replies
Last updated: Jul 12, 2022
T
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:
T
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
T
this is the exact same error message, that netlify gives me as well.
T
yet building it locally works just fine, on node 16 & node 17
T
I am thankful for any and all ideas
T
In root, it only has lerna as a dependency. I just ran
npm upgrade --legacy-peer-deps, after that,
/studiolooks 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"
}
}T
even after the upgrade, the error still persists
T
I honestly don't know what to do.
T
so... what is my course of action here then?
T
ask for help with netlify?
T
I literally can't even update the site
T
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?
No, you don't need to rebuild. You could try adding a
To force it through.
.npmrcfile with:
legacy-peer-deps=true
K
Could you please set npm 7 as your engine in your package.json and try again please?
From version 8 onwards, npm is being aggressive with legacy peer dependencies, but npm 7 is fine with it.
"engines": {
"node": "16.x",
"npm": "7"
},T
Thank you
user F
& user M
- that helped! It's building now. You saved my week 🙂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.