Questions tagged [node-config]

Use this tag if you have a question specifically to https://www.npmjs.com/package/config. For other nodejs configuration question, you are probably better off using the nodejs tag.

Node-config is a popular package for managing configuration files for nodejs applications.

60 questions
1
vote
0 answers

Error: Configuration property "mongoURI" is not defined, when trying to deploy my api on render.com

I have trouble getting my web service up and running. I developed a full stack MERN application and have my client folder already successfully deployed. However, when I try to deploy my backend folder wolf-watch-server I am running into the…
Josua
  • 27
  • 3
1
vote
1 answer

Ensuring Azure keyvault secrets are loaded to config (node-config) at application startup

I have a NodeJS application that uses Node-Config (https://www.npmjs.com/package/config) to load application configurations. What I'm trying to do is to load secrets from Azure Keyvault to the config during startup, and ensure these are available…
rodneyt
  • 71
  • 7
1
vote
1 answer

node-config Error [ERR_REQUIRE_ESM]: Must use import to load ES Module /default.js

I am using ESM in my node project. Added "type": "module" in package.json // index.js import config from 'config' // default.js export default { time: 123, ... ... } But getting error in node-config Error: Cannot parse config file:…
Kiran Mali
  • 597
  • 4
  • 12
1
vote
0 answers

"Cannot read property" when using deferConfig of node-config in "TypeScript

I'm using node-config in TypeScript. I have the code like below: config/default.ts: import {deferConfig} from 'config/defer'; export default { service: { url: 'http://localhost', errorUrl: deferConfig(function() { …
someone
  • 100
  • 2
  • 8
1
vote
1 answer

Bypass NODE_ENV with node-config

I am trying to test my config files by validating them, nothing fancy, a schema, a list of envs, iterate over it, load the config and validate the variable against the schema. Problem is, to do that, I currently have to set process.env.NODE_ENV.…
DrakaSAN
  • 7,673
  • 7
  • 52
  • 94
1
vote
1 answer

Best practices for managing multiple environment variables in prodution

Although I am not familiar with DevOps best practices, I am trying to come up with a reliable and efficient method for managing multiple variables in production. The following represents my current…
1
vote
0 answers

How to use node-config in typescript with custom config interface?

This is a follow up to How to use node-config in typescript? since I couldn't find a proper answer. I'm relatively new to TS and I'm trying to convert our configs from json to typescript, while trying to incorporate types on the config. What we…
Codi
  • 511
  • 3
  • 19
1
vote
0 answers

Node-config: How to get not frozen data from config?

I've used node-config module in my project, and it pretty useful. But I've encountered use case which I don't know how to handle. Here is an example: I have a huge config with a lot of nested objects, here is simplified one: …
1
vote
1 answer

How to set env var at runtime or deployment to select the right config

1. Summarize the problem We are using a configuration module (node) that allows us to set various configuration options, for example database settings or other api endpoint settings with our firebase hosted app. if the APP_ENV variable is set to…
user10664542
  • 1,106
  • 1
  • 23
  • 43
1
vote
0 answers

Not able to pick up correct configuration setting for a node module

I am using config npm package to manage different environment setting with cross-env. I have developed a node_module which has its own config directory and contains a dev.json settings file and reading it as config.get("dbName"); I am using this…
Swesh
  • 150
  • 1
  • 17
1
vote
2 answers

Using node-config package, is there a way to set custom-environment-variables.json in javascript?

I'm having issues deploying to Now with node-config custom env vars. Now does not deploy my custom-environment-variables.json file, but I am able to import it and print it to the console. Is there a way to pass this object to node-config so it makes…
Eliezer Steinbock
  • 4,728
  • 5
  • 31
  • 43
1
vote
0 answers

Extend configuration with custom settings loaded from file

I am trying to extend the configuration for my application with value loaded from a custom configuration file. We are using node-config and this is what I am trying to do: // Server entry const config = require('config') // Merge setting from our…
1
vote
1 answer

NODE_APP_INSTANCE error with node-config and PM2

So I've been having some problems with PM2 and node-config. Whenever I run my app with PM2, I get the error; FATAL: NODE_APP_INSTANCE value of '0' did not match any instance config file names. I've tried all the documented ways of "fixing" this such…
user5113508
1
vote
1 answer

How repair error for node-config in typescript?

After installing node-config and @types/config: npm install config npm install @types/config When I am trying to use in my app: import config from 'config'; I am getting the error: Module not found: Error: Can't resolve 'fs' I installed the 'fs'…
1
vote
1 answer

How to mutate node-config in memory

I'm trying to mutate the value of my config in memory for testing, I've tried adding process.env.ALLOW_CONFIG_MUTATIONS=true in several spots in the application, as well as through the command line and my .env file. The…