Home > Software engineering >  Is there a configuration file for node js
Is there a configuration file for node js

Time:12-04

I have a problem with node and SSL. solution is using --use-openssl-ca option when running node. but I should always run my app with that option.

Is there a configuration file for node.js which I set that option in it?

CodePudding user response:

Answering your question. yes you can attach configuration file for nodejs but there is no global config file.

NODE_OPTIONS='--require "./my path/file.js"'

but this will not make the command line shorter.

  • if you are willing to add it for one specific project.

    then use package.json add a starter script there.

  • if you want it to be in the current bash. do this (Linux) :

export NODE_OPTIONS=--use-openssl-ca

in windows set NODE_OPTIONS=--use-openssl-ca

  • if you want default in every bash.
echo 'export NODE_OPTIONS=--use-openssl-ca' >> ~/.bashrc
  • Related