Skip to content

Error: Error: Configuration property <property_name> is not defined #14142

Discussion options

You must be logged in to vote

Hi 🤩,
After 2 hours of debugging, I found a solution.
In my project I am using the popular npm package - config, and it injects DB credential.
If someone has a similar problem, it should be add to your database/config/config.js file this:

const path = require("path");
process.env["NODE_CONFIG_DIR"] = path.resolve(__dirname, "../../config"); // Path to your config files
const config = require("config");

module.exports = {
  development: config.get("dbConfig"),
  test: config.get("dbConfig"),
  production: config.get("dbConfig"),
};

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dudek-igor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant