I want to trigger the postinstall hook of an npm package.
The package.json of that package looks as follows:
"scripts": {
"postinstall": "node ./bin/index.js",
},
The npm documentation is rather sparse on that topic.
It seems that the postinstall hook is only triggered for the package.json in the root of the project that executes npm i
and not for packages installed during npm i
. Is that correct?
Prisma is executing scripts during installation and it seems that they add their own logic to the root package.json. I am just not sure how they are able to trigger that code during npm i
in the first place.
It seems the postinstall hook is executed during deployment to App Engine on Google Cloud (and potentially other cloud environments). Why is it not executed locally? What is the difference?