I have added a new page today and pushed everything to my github, then the build has failed.
To be honest, I don’t know what is going on, I have only added a new component which is a new page, that’s all. I haven’t added any NPM libraries from the last commit with succesfull build.
The error is a peer dependency conflict relating to versions of react, which provides guidance on how you can attempt to resolve it:
11:06:39 AM: npm ERR! Fix the upstream dependency conflict, or retry
11:06:39 AM: npm ERR! this command with --force, or --legacy-peer-deps
11:06:39 AM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
It suggests you can run npm install --force or npm install --legacy-peer-deps.
To do this on Netlify you can use the NPM_FLAGS environment variable.
NPM_FLAGS: used to indicate the flags to pass to the npm install command.
Setting it to either --force or --legacy-peer-deps depending on your preference.
@hrishikesh I mean why did it suddenly break specifically in Netlify with 16.15.1? I have been using the —legacy-peer-deps flag to make my package-lock file since npm 8.0.0, and only now is Netlify giving me a build error.
Additionally, I can still build and serve this package locally. There has to be something more happening here.