Trying to bind a script called license-checker
to npm
commands following these instructions I came up with this snippet in my package.json
{
"scripts": {
"postinstall": "license-checker --json --out license-list.json",
"poststart": "license-checker --json --out license-list.json"
},
Doesn't work. Running the command manually does generate the licence-list.json
file, but not when installing a package (npm i package-name --save
). Why not?
Note: I'm trying to run this script when (1) installing a new package into the project, and also when (2) building the project for deployment. However there's nothing about build
in the docs: can I use start
or poststart
for that as I tried to or if not, what can I use instead?