Support absolute paths with the --env-file
CLI option.
#51625
Labels
feature request
Issues that request new features to be added to Node.js.
--env-file
CLI option.
#51625
What is the problem this feature will solve?
Well, the problem is really simple. Right now when you pass a file to
--env-file
such as:It will load correctly, provided you have a file called
.env
relative to the current working directory (as stated in the documentation).However, if you call the command with an absolute path such as:
It will throw an error, even if the file exists:
What is the feature you are proposing to solve the problem?
I propose that passing an absolute path to
--env-file
would detect it as such and try to load the file. Also, the current error message could be improved.Supporting absolute paths might sounds like a niche feature, but it can be very useful in the context of mono-repositories.
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: