We have to support 5 different cases with lifecycle scripts (prepare
and prepublish
) in node module based formulas. These are sorted by increasing difficulty / complexity to support:
- arbitrary download location with no
prepare
(orprepublish
) script: trivial to handle - npm registry tarball download (already prepared) with a
prepare
script, which could be run a second time without failure: runningprepare
twice would be unnecessary but wouldn't break anything - npm registry tarball download (already prepared) with a
prepare
script, which fails when run a second time (e.g. mkdir fails on already existing directory):--ignore-scripts
is required fornpm pack
(and if we want this case to be rooted through the bundledDependencies branch for consistency we would need to pass--production
to the first localnpm install
(because--ignore-scripts
won't work here, see npm background#1+4)) - source tarball downloads (not already prepared), but we don't want to run
prepare
(e.g. fo