You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
install, postinstall: Run AFTER the package is installed
This conflicts with descriptions I’ve seen all over the web[*], most of which say—vaguely, in the
passive voice—“after npm install is run”.
Does this mean that in my package.json, the postinstall script will run after I (myself) run npm install, i.e. when I’m installing dependencies? Or does it mean that if someone runs npm install my-package that my script will run on their computer after they install my package? I’ve searched all over the web and have gotten mixed answers. Please make the docs precisely clear about this.
The reason I ask is because would like to have a script run automatically after a user installs my package. The script runs a gulp task that generates dist files, which are not checked in to git.
If this script runs only after I run npm install, it isn’t helpful at all to users of my package. I would like the script to run after they install my package.
I'm opening this issue because:
npm is doing something I don't understand.
What's going wrong?
https://docs.npmjs.com/misc/scripts does not contain detailed documentation on the
preinstall
,install
, andpostinstall
scripts. It says:This conflicts with descriptions I’ve seen all over the web[*], most of which say—vaguely, in the
passive voice—“after npm install is run”.
Does this mean that in my
package.json
, thepostinstall
script will run after I (myself) runnpm install
, i.e. when I’m installing dependencies? Or does it mean that if someone runsnpm install my-package
that my script will run on their computer after they install my package? I’ve searched all over the web and have gotten mixed answers. Please make the docs precisely clear about this.The reason I ask is because would like to have a script run automatically after a user installs my package. The script runs a gulp task that generates dist files, which are not checked in to git.
If this script runs only after I run
npm install
, it isn’t helpful at all to users of my package. I would like the script to run after they install my package.[*]sources:
install
/postinstall
scripts being run before all dependencies are finished installing #5001The text was updated successfully, but these errors were encountered: