New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config just keeps finding ITS OWN base directory inside node_modules #330
Comments
When running an app that uses node-config, you have to be very aware of the current working directory. The only way the config package will incorrectly use /node_modules/config is if the current working directory is /node_modules, OR if $NODE_CONFIG_DIR is explicitly pointing to it. I've found that if you're unsure of your current working directory, using a relative path for $NODE_CONFIG_DIR doesn't help much. Try using a direct path for NODE_CONFIG_DIR, or try printing out process.cwd() before loading config so you know where it's running from. As far as using config with webpack, I don't have any experience with it, so others may want to chime in if webpack changes directories while running, etc. |
It's possible... check that... it's likely that I'm misuderstanding the errors I'm getting. I got the following errors when I ran webpack and assumed the library was trying to load itself as a config file...
My config file is just a plain javascript file and it looks like this:
|
Closing, as this does not appear to be a bug in |
I just installed config and started playing around with it. I have a directory structure like this:
Now I've tried every which way of setting this:
NODE_CONFIG_DIR=./resources/assets/js/myJsApp/config but no matter what I do, whenever I run webpack, it just finds your config directory and craps out a bunch of errors. Where am I going wrong here?
The text was updated successfully, but these errors were encountered: