`pnpm dev` fails because of `sharp`: the warning that blocks everything
I run pnpm dev and nothing starts. No error in my code. Just this: [ERR_PNPM_IGNORED_BUILDS] Ignored build scripts: sharp@0.34.5 Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts. [ERROR] Command failed with exit code 1: pnpm install Before running the script, pnpm checks the status of the dependencies. This check was failing, so the server wouldn't start…
A developer in Paris identified a way to resolve an error where the command `pnpm dev` fails due to the `[ERR_PNPM_IGNORED_BUILDS]` error. Recent versions of pnpm now require explicit approval to execute dependency installation scripts, which prevented tools like the image optimizer `sharp` from running their native binaries. The issue can be fixed by setting `allowBuilds: sharp: true` in the `pnpm-workspace.yaml` file or by running `pnpm approve-builds`.
It is recommended to approve packages individually rather than using `dangerouslyAllowAllBuilds` to maintain security.
Summarised by urgent.news, not translated. Machine-written; may contain errors — check the original.
Source: dev.to