I'm trying to set NODE_EXTRA_CA_CERTS
in a node script like so:
// package.json
"scripts": {
"load-cert": "export NODE_EXTRA_CA_CERTS=cert.pem",
"start": "node main.js"
},
npm run load-cert && npm run start
But that doesn't work (gives SSL error). Specifically, I think, because I'm loading the contract in its own separate script then running a different script/command.
This also doesn't work
"scripts": {
"load-cert": "export NODE_EXTRA_CA_CERTS=riotgames.pem",
"start": "npm run load-cert && node main.js"
},
npm run start
The following script works:
"scripts": {
"start": "export NODE_EXTRA_CA_CERTS=cert.pem && node main.js"
},
npm run start
Weirdly enough, this also works:
"scripts": {
"start": "node main.js",
"load-cert-start": "export NODE_EXTRA_CA_CERTS=riotgames.pem && npm run start"
},
npm run load-cert-start
Can anyone help me understand why this is happening and if there's a way I can have a script to just load the certificate?