René's URL Explorer Experiment


Title: --env-file-if-exists throws error when the .env file doesn't exist and when combined with --watch (now in lts) · Issue #57040 · nodejs/node · GitHub

Open Graph Title: --env-file-if-exists throws error when the .env file doesn't exist and when combined with --watch (now in lts) · Issue #57040 · nodejs/node

X Title: --env-file-if-exists throws error when the .env file doesn't exist and when combined with --watch (now in lts) · Issue #57040 · nodejs/node

Description: Version v22.14.0 v24.13.1, v25.6.1 Platform Linux arch 6.13.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 08 Feb 2025 18:54:55 +0000 x86_64 GNU/Linux Linux archlinux 6.18.9-zen1-2-zen #1 ZEN SMP PREEMPT_DYNAMIC Mon, 09 Feb 2026 17:45:06 +0000 x8...

Open Graph Description: Version v22.14.0 v24.13.1, v25.6.1 Platform Linux arch 6.13.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 08 Feb 2025 18:54:55 +0000 x86_64 GNU/Linux Linux archlinux 6.18.9-zen1-2-zen #1 ZEN SMP PREEMPT_DY...

X Description: Version v22.14.0 v24.13.1, v25.6.1 Platform Linux arch 6.13.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 08 Feb 2025 18:54:55 +0000 x86_64 GNU/Linux Linux archlinux 6.18.9-zen1-2-zen #1 ZEN SMP PREEMPT_DY...

Opengraph URL: https://github.com/nodejs/node/issues/57040

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"--env-file-if-exists throws error when the .env file doesn't exist and when combined with --watch (now in lts)","articleBody":"### Version\n\n~~v22.14.0~~\nv24.13.1, v25.6.1\n\n### Platform\n\n~~Linux arch 6.13.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 08 Feb 2025 18:54:55 +0000 x86_64 GNU/Linux~~\n```text\nLinux archlinux 6.18.9-zen1-2-zen #1 ZEN SMP PREEMPT_DYNAMIC Mon, 09 Feb 2026 17:45:06 +0000 x86_64 GNU/Linux\n```\n\n### Subsystem\n\n_No response_\n\n### What steps will reproduce the bug?\n\nRun any script in a project where a .env file _**doesn't exist**_:\n\n```bash\nmkdir repro \u0026\u0026 cd repro \u0026\u0026 npm init -y \u0026\u0026 echo \"console.log('repro');\" \u003e main.js\nnode --env-file-if-exists=.env --watch main.js\n```\n\nIf the .env file exists or you don't use the `--watch` flag, script runs normally without throwing errors.\n\n### How often does it reproduce? Is there a required condition?\n\nThese need to be true for the problem to occur:\n\n- use the flag `--env-file-if-exists` pointing to a non existing .env file, like `--env-file-if-exists=.env`\n- use the flag `--watch`\n\n### What is the expected behavior? Why is that the expected behavior?\n\nScript should run normally with the following message being printed right before it:\n\n\u003e .env not found. Continuing without it.\n\n\n### What do you see instead?\n\nAn error stating .env was not found.\n\n```bash\n.env not found. Continuing without it.\nnode:internal/fs/watchers:247\n    const error = new UVException({\n                  ^\n\nError: ENOENT: no such file or directory, watch '/home/mkvlrn/sandbox/repro/.env'\n    at FSWatcher.\u003ccomputed\u003e (node:internal/fs/watchers:247:19)\n    at watch (node:fs:2550:36)\n    at FilesWatcher.watchPath (node:internal/watch_mode/files_watcher:109:21)\n    at FilesWatcher.filterFile (node:internal/watch_mode/files_watcher:128:12)\n    at start (node:internal/main/watch_mode:78:13)\n    at init (node:internal/main/watch_mode:148:15)\n    at node:internal/main/watch_mode:160:1 {\n  errno: -2,\n  syscall: 'watch',\n  code: 'ENOENT',\n  path: '/home/mkvlrn/sandbox/repro/.env',\n  filename: '/home/mkvlrn/sandbox/repro/.env'\n}\n\nNode.js v22.14.0\n.env not found. Continuing without it.\nrepro\nnode:events:496\n      throw er; // Unhandled 'error' event\n      ^\n\nError: write EPIPE\n    at target._send (node:internal/child_process:877:20)\n    at target.send (node:internal/child_process:751:19)\n    at reportModuleToWatchMode (node:internal/modules/cjs/loader:279:13)\n    at Function._load (node:internal/modules/cjs/loader:1097:5)\n    at TracingChannel.traceSync (node:diagnostics_channel:322:14)\n    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)\n    at node:internal/main/run_main_module:36:49\nEmitted 'error' event on process instance at:\n    at node:internal/child_process:881:39\n    at process.processTicksAndRejections (node:internal/process/task_queues:85:11) {\n  errno: -32,\n  code: 'EPIPE',\n  syscall: 'write'\n}\n\nNode.js v22.14.0\n```\n\n### Additional information\n\nThis is almost a 100% copy of a previous issue (#56887) I had opened a couple weeks back, but that issue was found on the latest/23 version, while not present in the then current LTS `v22.13.1`. Now it is happening in the LTS `22.14` version. Still working fine in `22.13.1`.\n\n_22.13.1_\n![Image](https://github.com/user-attachments/assets/50da0f84-f0da-4498-a2c4-d6ecf4dd71ca)\n\n_22.14_\n![Image](https://github.com/user-attachments/assets/0ac1799c-0264-4b8a-b342-2afa78c49bff)","author":{"url":"https://github.com/mkvlrn","@type":"Person","name":"mkvlrn"},"datePublished":"2025-02-13T22:13:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/57040/node/issues/57040"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:30c50ba7-782f-11d3-2e0f-9ab835f849d7
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD916:A3B49:12488F7:18FB8AB:6A4D6B1C
html-safe-nonce47659971f602fd8740e30e7aa92ce16f1dce9e02571828ba77c7da266049ab53
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTE2OkEzQjQ5OjEyNDg4Rjc6MThGQjhBQjo2QTRENkIxQyIsInZpc2l0b3JfaWQiOiIxNjcyMjcyNzE0MjEzOTc2ODYwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac88eb6ccfe6c2ee6cafaf3686aff73d4d57dace54c412eba4ae16269295066747
hovercard-subject-tagissue:2852213718
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/57040/issue_layout
twitter:imagehttps://opengraph.githubassets.com/405123438d7d2a030652503d134b304f7c6926ce757765684395c36a4449be4a/nodejs/node/issues/57040
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/405123438d7d2a030652503d134b304f7c6926ce757765684395c36a4449be4a/nodejs/node/issues/57040
og:image:altVersion v22.14.0 v24.13.1, v25.6.1 Platform Linux arch 6.13.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 08 Feb 2025 18:54:55 +0000 x86_64 GNU/Linux Linux archlinux 6.18.9-zen1-2-zen #1 ZEN SMP PREEMPT_DY...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemkvlrn
hostnamegithub.com
expected-hostnamegithub.com
None7db3950e3f59095e20a9789440c3dd554efc62d434882ead06ae05b5815605b9
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasecd8f6a71db61d6012a0cbb134be844fdbe9b8a45
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/issues/57040#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F57040
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F57040
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/57040
Reloadhttps://github.com/nodejs/node/issues/57040
Reloadhttps://github.com/nodejs/node/issues/57040
Please reload this pagehttps://github.com/nodejs/node/issues/57040
nodejs https://github.com/nodejs
nodehttps://github.com/nodejs/node
Please reload this pagehttps://github.com/nodejs/node/issues/57040
Notifications https://github.com/login?return_to=%2Fnodejs%2Fnode
Fork 36k https://github.com/login?return_to=%2Fnodejs%2Fnode
Star 118k https://github.com/login?return_to=%2Fnodejs%2Fnode
Code https://github.com/nodejs/node
Issues 1.4k https://github.com/nodejs/node/issues
Pull requests 962 https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality 0 https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
Code https://github.com/nodejs/node
Issues https://github.com/nodejs/node/issues
Pull requests https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
#61870https://github.com/nodejs/node/pull/61870
--env-file-if-exists throws error when the .env file doesn't exist and when combined with --watch (now in lts)https://github.com/nodejs/node/issues/57040#top
#61870https://github.com/nodejs/node/pull/61870
https://github.com/mkvlrn
mkvlrnhttps://github.com/mkvlrn
on Feb 13, 2025https://github.com/nodejs/node/issues/57040#issue-2852213718
#1https://github.com/nodejs/node/pull/1
#56887https://github.com/nodejs/node/issues/56887
https://private-user-images.githubusercontent.com/186238078/413081982-50da0f84-f0da-4498-a2c4-d6ecf4dd71ca.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODM0NTg4ODgsIm5iZiI6MTc4MzQ1ODU4OCwicGF0aCI6Ii8xODYyMzgwNzgvNDEzMDgxOTgyLTUwZGEwZjg0LWYwZGEtNDQ5OC1hMmM0LWQ2ZWNmNGRkNzFjYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNzA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDcwN1QyMTA5NDhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05MWRmNzRlZDFiNTBjZTY3YTE1Mzc3ZDcxYjZhZTQzNDA2NDRkMTYxNTQ4Y2ZkZDg4N2RiYzEzZTdjZThmNTIyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.mVwMyzDUtcq_LsKVbpF2x5Rd1jpnGuWCg6W3f5poc-c
https://private-user-images.githubusercontent.com/186238078/413082357-0ac1799c-0264-4b8a-b342-2afa78c49bff.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODM0NTg4ODgsIm5iZiI6MTc4MzQ1ODU4OCwicGF0aCI6Ii8xODYyMzgwNzgvNDEzMDgyMzU3LTBhYzE3OTljLTAyNjQtNGI4YS1iMzQyLTJhZmE3OGM0OWJmZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNzA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDcwN1QyMTA5NDhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03ZDdhNDI3NTE2MTg0ZGQ3OWUxNjZlYTFjMzA0OWM3M2M4ZWU0NmZkNGMzNmM1ODAzNTEyMjVhNjZhOGQ2N2ZlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.KRQPmz5kFF8-HYyWX8pN_2pMDx5Co-yRfBubt3aHJrM
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.