Open greim opened 2 years ago
I generally agree, but wouldn't prepublish
work before install
? Furthermore, the latest npm seems to work even if it is not local.
https://docs.npmjs.com/cli/v8/using-npm/scripts
This is probably an npm problem and there is a stackoverflow page that looks like a nightmare. https://stackoverflow.com/questions/23076968/npm-postinstall-only-on-development
My head is spinning trying to describe this, so hopefully I can explain myself clearly. You have two fictitious libraries:
lib-js
which usesnpm-force-resolutions
app-js
which useslib-js
I assert that
lib-js
should be doing this in itspackage.json
:...not what's currently specified in the README, which is this:
Why? Because
"preinstall"
runsnpm-force-resolutions
whenapp-js
does an install, where it has no business running. It causes issues such as this."prepublish"
OTOH should only runnpm-force-resolutions
when devs oflib-js
do a publish or install, which is when you actually want it to run, since its job is to updatepackage-lock.json
, not mess with the installs of consuming packages.Please let me know if I'm misunderstanding something.