After changing this website to pnpm I noticed netlify don't seem to officially support it.
There are a few issue tickets relating to this & the general idea seems to be to disable npm install then run pnpm install to install dependencies on a prebuild script.
- Disable npm with
NPM_FLAGS = "--prefix=/dev/null"
pnpm installpre build
There seem to be a few ways to implement this
- create netlify plugin
- add prebuild script to
I thought the easiest & cleanest way was to add
pnpm i to
[build.environment] NODE_VERSION = "14" NPM_FLAGS = "--prefix=/dev/null" [build] publish = "public" command = "npx pnpm i --store=node_modules/.pnpm-store && npx pnpm run build"
The source for the site is available on github.