@jen thanks for the response!
I’m not calling yarn because netlify calls yarn for me (instead of npm i when it detects a yarn.lock).
That said, I got some help on this from someone else trying to tackle the same issue (the goal here with the pre-install hook is to improve the unsupported Lerna monorepo node_modules caching to reduce build times), and he pointed out that netlify is calling yarn in the monorepo subdir not the root dir, which I hadn’t thought of. So I think I need to put the preinstall script in the monorepo package’s package.json instead of the root package.json - in case that helps anyone else running into the issue.
I haven’t had a chance to test this yet, but I feel like it’s pretty promising and likely explains my problem.
Would definitely love to see yarn workspaces / lerna monorepo get some more love as a first-class citizen in the Netlify world, if you’re taking feature requests. Really love Netlify, and appreciate all that you guys do, I know you have a lot on your plate though! Thanks!