NODE_CONFIG_DIR is not updating when using import #750
-
|
I am trying to update NODE_CONFIG_DIR Output is Output is When I am printing |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
|
I encounter the same issue. Why? The bug is obvious, but the author does not care it? |
Beta Was this translation helpful? Give feedback.
-
|
@vinayverismart You can use import function like this: |
Beta Was this translation helpful? Give feedback.
-
|
And this is the other reason why my attempts to convert this package to ESM stalled. Import cannot be forced to reload a package the way require can. And all of the test suites rely on doing so. There’s also another problem with import and using it inside the config directory that I got wedged on, which is the more intractable issue. |
Beta Was this translation helpful? Give feedback.
-
|
You will need to set these environment variables before triggering the import chain because Edit to add: There aren't a lot of environment variables I like to set in a setup shell or in pm2.config but this is for certain one of them. |
Beta Was this translation helpful? Give feedback.
You will need to set these environment variables before triggering the import chain because
importis far more aggressive thanrequire(). This is a Node.js decision about determinism rather than a bug with node-config.Edit to add: There aren't a lot of environment variables I like to set in a setup shell or in pm2.config but this is for certain one of them.