require('config') loaded nothing in debugHow do I debug Node.js applications?Understanding Node.js modules: multiple requires return the same object?How do I debug “Error: spawn ENOENT” on node.js?Using Node.js require vs. ES6 import/exportMocha - Test a module with a modification config fileNodejs require configNodeJs : Require is not definedCan I use node-config to load configuration settings from config files created by other libraries such as sequelize-cli?Node-config custom-environment-variables not Picking Docker environment VariablesParse error when config reading the development.json

I caught several of my students plagiarizing. Could it be my fault as a teacher?

Was Hulk present at this funeral?

I lost my Irish passport. Can I travel to Thailand and back from the UK using my US passport?

What happened to Ghost?

How can I close a gap between my fence and my neighbor's that's on his side of the property line?

The barbers paradox first order logic formalization

Is balancing necessary on a full-wheel change?

What are the spoon bit of a spoon and fork bit of a fork called?

How could a planet have most of its water in the atmosphere?

How to creep the reader out with what seems like a normal person?

Was Unix ever a single-user OS?

How to efficiently calculate prefix sum of frequencies of characters in a string?

Entropy as a function of temperature: is temperature well defined?

Airbnb - host wants to reduce rooms, can we get refund?

Map one pandas column using two dictionaries

Is this homebrew race based on the Draco Volans lizard species balanced?

If 1. e4 c6 is considered as a sound defense for black, why is 1. c3 so rare?

What happens if I start too many background jobs?

Field Length Validation for Desktop Application which has maximum 1000 characters

If Melisandre foresaw another character closing blue eyes, why did she follow Stannis?

Can commander tax be proliferated?

What word means "to make something obsolete"?

How to back up a running Linode server?

Feels like I am getting dragged into office politics



require('config') loaded nothing in debug


How do I debug Node.js applications?Understanding Node.js modules: multiple requires return the same object?How do I debug “Error: spawn ENOENT” on node.js?Using Node.js require vs. ES6 import/exportMocha - Test a module with a modification config fileNodejs require configNodeJs : Require is not definedCan I use node-config to load configuration settings from config files created by other libraries such as sequelize-cli?Node-config custom-environment-variables not Picking Docker environment VariablesParse error when config reading the development.json






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















My nodejs app config = require('config') (3.0.1) returns nothing in debug. Here is the console output:



 config: 
Config


NODE_ENV is only defined in development.json and loading in development has no problem.



Here is the files under ./config:



enter image description here



What could cause the config module failed to load in debug?










share|improve this question






















  • You need an index.js in the config directory. Do you want an exemple of config dir ?

    – Julien TASSIN
    Mar 22 at 20:27











  • Julien TASSIN, an example would be very helpful. Thanks.

    – user938363
    Mar 22 at 20:42











  • oh, sorry my bad I did not see that you used node-config, I thought you were using pure nodejs. I don't know this lib :/

    – Julien TASSIN
    Mar 22 at 20:53

















0















My nodejs app config = require('config') (3.0.1) returns nothing in debug. Here is the console output:



 config: 
Config


NODE_ENV is only defined in development.json and loading in development has no problem.



Here is the files under ./config:



enter image description here



What could cause the config module failed to load in debug?










share|improve this question






















  • You need an index.js in the config directory. Do you want an exemple of config dir ?

    – Julien TASSIN
    Mar 22 at 20:27











  • Julien TASSIN, an example would be very helpful. Thanks.

    – user938363
    Mar 22 at 20:42











  • oh, sorry my bad I did not see that you used node-config, I thought you were using pure nodejs. I don't know this lib :/

    – Julien TASSIN
    Mar 22 at 20:53













0












0








0








My nodejs app config = require('config') (3.0.1) returns nothing in debug. Here is the console output:



 config: 
Config


NODE_ENV is only defined in development.json and loading in development has no problem.



Here is the files under ./config:



enter image description here



What could cause the config module failed to load in debug?










share|improve this question














My nodejs app config = require('config') (3.0.1) returns nothing in debug. Here is the console output:



 config: 
Config


NODE_ENV is only defined in development.json and loading in development has no problem.



Here is the files under ./config:



enter image description here



What could cause the config module failed to load in debug?







node.js node-config






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 22 at 20:08









user938363user938363

2,5671466143




2,5671466143












  • You need an index.js in the config directory. Do you want an exemple of config dir ?

    – Julien TASSIN
    Mar 22 at 20:27











  • Julien TASSIN, an example would be very helpful. Thanks.

    – user938363
    Mar 22 at 20:42











  • oh, sorry my bad I did not see that you used node-config, I thought you were using pure nodejs. I don't know this lib :/

    – Julien TASSIN
    Mar 22 at 20:53

















  • You need an index.js in the config directory. Do you want an exemple of config dir ?

    – Julien TASSIN
    Mar 22 at 20:27











  • Julien TASSIN, an example would be very helpful. Thanks.

    – user938363
    Mar 22 at 20:42











  • oh, sorry my bad I did not see that you used node-config, I thought you were using pure nodejs. I don't know this lib :/

    – Julien TASSIN
    Mar 22 at 20:53
















You need an index.js in the config directory. Do you want an exemple of config dir ?

– Julien TASSIN
Mar 22 at 20:27





You need an index.js in the config directory. Do you want an exemple of config dir ?

– Julien TASSIN
Mar 22 at 20:27













Julien TASSIN, an example would be very helpful. Thanks.

– user938363
Mar 22 at 20:42





Julien TASSIN, an example would be very helpful. Thanks.

– user938363
Mar 22 at 20:42













oh, sorry my bad I did not see that you used node-config, I thought you were using pure nodejs. I don't know this lib :/

– Julien TASSIN
Mar 22 at 20:53





oh, sorry my bad I did not see that you used node-config, I thought you were using pure nodejs. I don't know this lib :/

– Julien TASSIN
Mar 22 at 20:53












1 Answer
1






active

oldest

votes


















1














The config filenames need to be tied to the NODE_ENV or NODE_CONFIG_ENV you're setting when you run your app. (https://github.com/lorenwest/node-config/wiki/Configuration-Files#file-load-order)



You don't set NODE_ENV in the config files themselves.



So for example (assuming the command to run your app is npm start):



NODE_CONFIG_ENV=foo npm start



^ This would first load all of the config properties in default.json, then override them with any properties you set in foo.json. If you wanted to add a local.json, those properties would be a final override.



I believe it defaults to assuming your env is "development", and I'm guessing your default.json is empty.






share|improve this answer























  • All setting goes to the default.json as well. The issue is the the config is loaded successfully in normal development (for ex, when node index.js) but not in debug with VS code. I posted on VS code to find out if this is something related to the IDE.

    – user938363
    Mar 23 at 18:16












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307109%2frequireconfig-loaded-nothing-in-debug%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














The config filenames need to be tied to the NODE_ENV or NODE_CONFIG_ENV you're setting when you run your app. (https://github.com/lorenwest/node-config/wiki/Configuration-Files#file-load-order)



You don't set NODE_ENV in the config files themselves.



So for example (assuming the command to run your app is npm start):



NODE_CONFIG_ENV=foo npm start



^ This would first load all of the config properties in default.json, then override them with any properties you set in foo.json. If you wanted to add a local.json, those properties would be a final override.



I believe it defaults to assuming your env is "development", and I'm guessing your default.json is empty.






share|improve this answer























  • All setting goes to the default.json as well. The issue is the the config is loaded successfully in normal development (for ex, when node index.js) but not in debug with VS code. I posted on VS code to find out if this is something related to the IDE.

    – user938363
    Mar 23 at 18:16
















1














The config filenames need to be tied to the NODE_ENV or NODE_CONFIG_ENV you're setting when you run your app. (https://github.com/lorenwest/node-config/wiki/Configuration-Files#file-load-order)



You don't set NODE_ENV in the config files themselves.



So for example (assuming the command to run your app is npm start):



NODE_CONFIG_ENV=foo npm start



^ This would first load all of the config properties in default.json, then override them with any properties you set in foo.json. If you wanted to add a local.json, those properties would be a final override.



I believe it defaults to assuming your env is "development", and I'm guessing your default.json is empty.






share|improve this answer























  • All setting goes to the default.json as well. The issue is the the config is loaded successfully in normal development (for ex, when node index.js) but not in debug with VS code. I posted on VS code to find out if this is something related to the IDE.

    – user938363
    Mar 23 at 18:16














1












1








1







The config filenames need to be tied to the NODE_ENV or NODE_CONFIG_ENV you're setting when you run your app. (https://github.com/lorenwest/node-config/wiki/Configuration-Files#file-load-order)



You don't set NODE_ENV in the config files themselves.



So for example (assuming the command to run your app is npm start):



NODE_CONFIG_ENV=foo npm start



^ This would first load all of the config properties in default.json, then override them with any properties you set in foo.json. If you wanted to add a local.json, those properties would be a final override.



I believe it defaults to assuming your env is "development", and I'm guessing your default.json is empty.






share|improve this answer













The config filenames need to be tied to the NODE_ENV or NODE_CONFIG_ENV you're setting when you run your app. (https://github.com/lorenwest/node-config/wiki/Configuration-Files#file-load-order)



You don't set NODE_ENV in the config files themselves.



So for example (assuming the command to run your app is npm start):



NODE_CONFIG_ENV=foo npm start



^ This would first load all of the config properties in default.json, then override them with any properties you set in foo.json. If you wanted to add a local.json, those properties would be a final override.



I believe it defaults to assuming your env is "development", and I'm guessing your default.json is empty.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 23 at 7:28









Ben ChamberlinBen Chamberlin

514212




514212












  • All setting goes to the default.json as well. The issue is the the config is loaded successfully in normal development (for ex, when node index.js) but not in debug with VS code. I posted on VS code to find out if this is something related to the IDE.

    – user938363
    Mar 23 at 18:16


















  • All setting goes to the default.json as well. The issue is the the config is loaded successfully in normal development (for ex, when node index.js) but not in debug with VS code. I posted on VS code to find out if this is something related to the IDE.

    – user938363
    Mar 23 at 18:16

















All setting goes to the default.json as well. The issue is the the config is loaded successfully in normal development (for ex, when node index.js) but not in debug with VS code. I posted on VS code to find out if this is something related to the IDE.

– user938363
Mar 23 at 18:16






All setting goes to the default.json as well. The issue is the the config is loaded successfully in normal development (for ex, when node index.js) but not in debug with VS code. I posted on VS code to find out if this is something related to the IDE.

– user938363
Mar 23 at 18:16




















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307109%2frequireconfig-loaded-nothing-in-debug%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현