I have an NPM project, when npm install
is run, I'd like to run a custom script.
I tried using this in package.json:
"scripts": {
"ng": "ng",
"start": "ng serve",
"install": "./scripts/install.sh", // <<<<
},
but that actually just resulted in an infinite loop.
The reason I am looking for this, is because there are tools that simply call npm install
, so I can't control what they run. Otherwise, if I had control, I would just call ./scripts/install.sh
myself instead.
Note that this is probably not the best idea, just curious if it's possible.
Note my install script looks something like this:
#!/usr/bin/env bash
export FOO="bar";
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true";
npm install