TransWikia.com

Why am I getting "Configuration property is not defined"?

Stack Overflow Asked by Chiahao on March 2, 2021

When I run my index.js file, I am getting Configuration property "mail.host" is not defined. I don’t understand why.

config.get('name') works fine. I set my NODE_ENV=production. Can anyone please help?

index.js

const config = require('config');
console.log(config.get('name'));
console.log(config.get('mail.host'));

production.json

{
  "name": "My app - production",
  "mail": {
    "host": "production-server"
  }
}

One Answer

It works after restarting my Terminal.

Answered by Chiahao on March 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP