I added one line to my own npm config a few months ago and stopped worrying about install hooks. The line was ignore-scripts=true, sitting in my user-level .npmrc, and in my head it worked like a lock on my front door. Any package I installed could bring whatever code it wanted in its install step, and my machine would just refuse to run it. That was the deal I thought I'd made with npm.
Then cryptostrapon asked a question in the comments on the install-hooks piece that I couldn't answer from memory. If a repo ships its own .npmrc that says ignore-scripts=false, does that beat my setting? I had a guess. My guess was wrong in the direction that matters, so I ran the test instead of arguing from memory.
The test was small on purpose. I built a package with one preinstall hook and nothing else. The hook writes a small marker file with a timestamp and prints a line, and the package itself does nothing at all.…