Month:

January 2025

NPM install lifecycle scripts (preinstall, install, postinstall) not being called for your package?

If you just added one of these lifecycle scripts to your package and published the changes to a registry:

In package-lock.json of the project that consumes your package as a dependency, ensure your package has "hasInstallScript": true. On npm ci or npm install, npm looks for the existence of this flag in package-lock.json rather than scanning each library… Read more