How do I setup the dotenv file in Node.js?

前端 未结 30 1176

I am trying to use the dotenv NPM package and it is not working for me. I have a file config/config.js with the following content:



        
30条回答
  •  情深已故
    2020-12-07 14:53

    Save yourself some troubleshooting time and log your require call, like so:

    console.log(require('dotenv').config())
    

    You should see an error with more detailed info on the problem.

提交回复
热议问题