I can’t get my
preinstall lifecycle hook to run during netlify’s build. It runs fine locally when I do a
yarn install, but does not run in the netlify build environment.
Here’s a minimal test case reproduction: I added this commit to a barebones test-repo: https://github.com/jaredh159/monorepo-test/commit/516a7b0d6591ffee1a451e4a890ffefcecfdc753
hello package just deploys a static
index.html file from
packages/hello/build/index.html. The preinstall script I wrote adds a line to the end of the file. And I modified the
build command so that it
cats out the file, as a test of whether it’s working on Netlify. (Also the deployed site would have the added line, but cat-ing it out allows it to be seen in the deploy logs as well).
Here’s the deploy log: https://app.netlify.com/sites/monorepo-test/deploys/5e9f4765da46f10007e4d1cb
And the published site, not showing the
PREINSTALL text: https://monorepo-test.netlify.app/