Thanks for the post! I would like to use .env variables in my cli app but when I npm link it, it cannot reach my .env files from any other directories. Do you have any advice solving this problem?
Thanks for reading! Have you tried setting the exact path of your .env file in the .env config as so:
require('dotenv').config({ path: '/absolute/path/to/your/.env/file' })
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the post! I would like to use .env variables in my cli app but when I npm link it, it cannot reach my .env files from any other directories. Do you have any advice solving this problem?
Thanks for reading!
Have you tried setting the exact path of your .env file in the .env config as so: