I feel puzzled by the following behavior. In the very beginning of my main index.js
, I am using
require('dotenv').config();
console.log(process.env); // everything seems in order
I know that the rest of my code successfully access all the relevant process.env.${VARS}
. However, I get SSL exceptions; exceptions that I can easily solve by
export NODE_EXTRA_CA_CERTS=/some/absolute/path/to/ca.pem
npm start
Is there something special about NODE_EXTRA_CA_CERTS
that would explained why this specific variable set with require('dotenv').config()
does not work while the others work like a charm?
Does it need to be set before running npm
? If it does, why is it the case and are there any workaround so I could keep thing simple?
environement:
- dotenv 16.0.0
- node v16.13.2