Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Both pnpm and yarn implemented npmMinimalAgeGate: 1440 enableScripts: false

These mostly solve the issue of adding postinstall scripts and packages being compromised.



enableScripts: false is a great default, but in a pnpm workspace monorepo it needs some tuning — a few packages legitimately rely on postinstall (esbuild, sharp, etc. downloading platform binaries).

What worked for us was whitelisting just those in onlyBuiltDependencies. Everything else stays locked down.

The age gate is a nice extra layer. I do wonder how well it holds up for fast-moving deps where you actually want the latest patch though.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: