isaacs/npm — Issue #1573: link running install scripts
Author: sethvargo
Created: 2011-10-19 20:15:28+00:00
State: open

The `npm link [...]` command runs the underlying `npm install [...]` command. However, in doing so, it also fires all the `pre-install`, `install`, and `postinstall` hooks that are build in to the `package.json` file...

I'm writing a script that is meant to be installed globally (because it runs a daemon), but then linked to each project. However, when linking, it runs the `install` hook again and starts a second daemon. Yeah, I *could* modify my code to check if the daemon is already running, but having `link` behave the same as install doesn't seem reasonable to me.

Additionally, if this is agreed, it makes sense to add hooks for `prelink`, `link`, and `postlink`, as it's very possible they are different operations...