Hi, builds for some of my client’s websites have starting failing without any change on my part in the code or anywhere else.
This is because for some reason Netlify started using NPM instead of Yarn to install the dependencies, and NPM is stricter with the peer dependencies.
These are the two websites where I’ve noticed this (they share the same codebase):
Here you can see a successful and failing builds:
and see how they only differ in that the successful one says:
“Installing NPM modules using Yarn version 1.22.4”
and the failing one says:
“Installing NPM modules using NPM version 8.19.2”
Here is the relevant error message from the Netlify build logs:
9:35:50 AM: The package manager we have detected () through a lock file or the `packageManager` property inside your `package.json`, does not align with the environment variable NETLIFY_USE_YARN=true you have specified!
@zachwe I didn’t have that error, so I tried using NETLIFY_USE_YARN = "true" in my netlify.toml and "packageManager": "email@example.com", in my package.json but all I managed was to start getting that error, still no build…
This started happening to my Netlify sites two days ago. It’s set up to use Yarn and randomly started using NPM and getting this error. Did it stop happening to everyone on this thread? Did yall do anything to fix it?
We had the opposite issue, we have Netlify set to use NPM, but it started using Yarn instead, even with NETLIFY_USE_YARN set to false.
Site: Netlify App
We have a monorepo using yarn workspaces, but were using npm to build the Netlify app because there were issues using yarn in Netlify.
@hrishikesh This problem started happening to me again (Installing NPM modules using NPM version 6.14.4 on a Yarn project), only noticed on one website so far: pelaterra-landingpage-site-x77vx3gx, build 638e6b6d7df82d09fcac01d7.
This doesn’t break the build due to peer dependencies this time, but does break because later it tries to run yarn build and cannot find yarn.
This started happening to me today as well and I made no code changes. I thought it was due to the Github issue that was reported earlier (Netlify Status - Failure of Some GitHub-triggered Builds), but that has been resolved and my site builds are still failing after attempting to install dependencies with NPM.
Another new error I’m noticing in the logs is “Failed to get framework information, continuing with build”. After this point, it attempts to install dependencies with NPM instead of Yarn.
Hey I’m already working on this issue it seems that the framework detection is failing.
Failed during stage 'Detect user site framework': @netlify/build-info failed: TypeError: Cannot read properties of undefined (reading 'version')\n at getFrameworkVersion (file:///opt/buildhome/node-deps/node_modules/@netlify/framework-info/src/main.js:72:28)
Which is then crashing our package manager detection and therefore we fallback always to NPM. Will try to push the fix out today.