Error with `sanity-nextjs-landing-pages` starter during Netlify build
10 replies
Last updated: Oct 21, 2022
A
hi all - not sure if this is the right place for this, but was trying out the
sanity-nextjs-landing-pagesstarter and got an error during the initial netlify build of the front-end
Oct 21, 2022, 3:14 PM
A
10:14:42 AM: Installing NPM modules using NPM version 8.19.2 10:14:43 AM: npm ERR! code ERESOLVE 10:14:43 AM: npm ERR! ERESOLVE could not resolve 10:14:43 AM: npm ERR! 10:14:43 AM: Creating deploy upload records 10:14:43 AM: npm ERR! While resolving: eslint-config-standard@16.0.3 10:14:43 AM: npm ERR! Found: eslint@8.8.0 10:14:43 AM: npm ERR! node_modules/eslint 10:14:43 AM: npm ERR! dev eslint@"^8.8.0" from the root project 10:14:43 AM: npm ERR! peer eslint@"^6.0.0 || ^7.0.0 || ^8.0.0" from @typescript-eslint/parser@5.10.2 10:14:43 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (<https://ntl.fyi/exit-code-1>) 10:14:43 AM: npm ERR! node_modules/@typescript-eslint/parser 10:14:43 AM: npm ERR! @typescript-eslint/parser@"^5.0.0" from eslint-config-next@12.0.10 10:14:43 AM: npm ERR! node_modules/eslint-config-next 10:14:43 AM: npm ERR! dev eslint-config-next@"^12.0.10" from the root project 10:14:43 AM: npm ERR! 12 more (eslint-config-next, eslint-config-prettier, ...) 10:14:43 AM: npm ERR! 10:14:43 AM: npm ERR! Could not resolve dependency: 10:14:43 AM: npm ERR! peer eslint@"^7.12.1" from eslint-config-standard@16.0.3 10:14:43 AM: npm ERR! node_modules/eslint-config-standard 10:14:43 AM: npm ERR! dev eslint-config-standard@"^16.0.3" from the root project 10:14:43 AM: npm ERR! 10:14:43 AM: npm ERR! Conflicting peer dependency: eslint@7.32.0 10:14:43 AM: npm ERR! node_modules/eslint 10:14:43 AM: npm ERR! peer eslint@"^7.12.1" from eslint-config-standard@16.0.3 10:14:43 AM: npm ERR! node_modules/eslint-config-standard 10:14:43 AM: npm ERR! dev eslint-config-standard@"^16.0.3" from the root project 10:14:43 AM: npm ERR! 10:14:43 AM: npm ERR! Fix the upstream dependency conflict, or retry 10:14:43 AM: npm ERR! this command with --force, or --legacy-peer-deps 10:14:43 AM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution. 10:14:43 AM: npm ERR! 10:14:43 AM: npm ERR! See /opt/buildhome/.npm/eresolve-report.txt for a full report. 10:14:43 AM: npm ERR! A complete log of this run can be found in: 10:14:43 AM: npm ERR! /opt/buildhome/.npm/_logs/2022-10-21T14_14_43_105Z-debug-0.log 10:14:43 AM: Error during NPM install 10:14:43 AM: Build was terminated: Build script returned non-zero exit code: 1 10:14:43 AM: Failing build: Failed to build site 10:14:43 AM: Finished processing build request in 6.20197214s
Oct 21, 2022, 3:14 PM
W
Im not 100%, but it seems like this starter was made using an older version of npm where peer dependencies werent being forced.
A workaround would be using
A workaround would be using
--legacy-peer-deps, but a fix would be updating your dependencies in such a way to make them compatible
Oct 21, 2022, 3:18 PM
W
(Also, thank you for not spamming a long log in the main channel as too many people do š)
Oct 21, 2022, 3:18 PM
A
thanks for the quick reply! hmm i was able to do an
also just wanted to report this to the sanity team so that theyāre aware their starter is failing the build for other people who may be trying it
npm installsuccessfully locally, and iām using the same version of npm (8.19.2) as the netlify buildā¦ iāll have to see how i can pass that arg to the netlify build process, or yeah just update my dependenciesā¦
also just wanted to report this to the sanity team so that theyāre aware their starter is failing the build for other people who may be trying it
Oct 21, 2022, 3:23 PM
A
and haha no prob, i was trying to avoid being that person š
Oct 21, 2022, 3:24 PM
W
if the point is informing the sanity team, id just recommend making a ticket on github
Oct 21, 2022, 3:27 PM
W
might it be that you locally use
npmand the netlify pipeline uses yarn? (not saying it does, trying to think of possibly causes given an equal npm version)
Oct 21, 2022, 3:27 PM
A
good point, looks like thereās already an issue raised for it, i added a š
Oct 21, 2022, 3:30 PM
A
btw, i misspoke earlier - the npm install in the root worked but the one in
weband
studioget the same error (at least itās consistent!)
Oct 21, 2022, 9:53 PM
A
using
--legacy-peer-depsdid work though, thanks for the tip
Oct 21, 2022, 9:53 PM
Sanityā build remarkable experiences at scale
Sanity is a 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.