-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
src: return error --env-file if file is missing #50588
src: return error --env-file if file is missing #50588
Conversation
Review requested:
|
3f6ba1c
to
b42914a
Compare
b42914a
to
fe0265f
Compare
226b7f9
to
f2365e5
Compare
Seems several CI have failed even already retrying, is this expected? 🤔 |
Unit testing goes error on Windows, will check later and maybe come back with a new push |
f2365e5
to
192d633
Compare
a2461d4
to
d3b85c1
Compare
Landed in 996d198 |
PR-URL: #50588 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
PR-URL: nodejs#50588 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
PR-URL: #50588 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
PR-URL: #50588 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
Is it intended that this change will break existing npm scripts and the CI processes that rely on them? I have a test script that runs tests with This script worked in CI before 20.11 because CI has env variables set up in the CI environment. Now it fails. My workaround will be to duplicate the test script without |
Hi, I have the same issue as @jmjf. Some of my scripts used #50993 seems like a nice alternative that would have been nice to ship at the same time, but it's not there yet. Also, it may have been sweeter to ship it the other way around, like adding a |
@acidoxee This is an experimental feature. Breaking changes are meant to happen. |
Breaking changes in LTS?
I guess I misunderstood LTS as being stable.
Nevertheless, these cases indicate that there are cases where no env file
is reasonable, so maybe this change should be reconsidered.
…On Sat, Jan 13, 2024, 08:45 Yagiz Nizipli ***@***.***> wrote:
@acidoxee <https://github.com/acidoxee> This is an experimental feature.
Breaking changes are meant to happen.
—
Reply to this email directly, view it on GitHub
<#50588 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AASIV63GFKYX4PAVZQKLSQTYOKFY7AVCNFSM6AAAAAA7AVC2P2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJQGQ3DGMBYGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Oh, my apologies then, I was pretty sure it was considered stable already for some reason. A notable change in the changelog would still have been nice, but you're 100% right to do breaking changes if it's experimental and if that leads to a better, thoughtful API in the end 👍 |
Hi, sorry for the noise this may cause: Are you considering adding the optionality back? It'd be nice to see a I can also try to do it myself, but I've 0 familiarity with Node's codebase and C++, when it might be an easy task for anyone more knowledgeable than me. Edit: There's already a Feature Request for this, #50993, and a related issue #51451 |
Motivated by #50536
NodeJS currently supports env file parsing. However, in cases where the file is missing, the process continues to execute. Since the env file is a crucial file, I propose that we return an error if the env file is missing. This will prevent errors in the future and allow us to detect them as early as possible.
Testing Scenario:
Given files tree:
run:
node --env-file=test.env hello.js
output: it will executed
run:
node --env-file=oops.env hello.js
output: node: oops.env not found
run:
node --env-file=test.env --env-file=test1.env hello.js
output: it will executed
run:
node --env-file=test.env --env-file=oops.env hello.js
output: node: oops.env not found