Title: node --watch-path: Does not restart when re-creating subdir on Linux · Issue #67592 · nodejs/node · GitHub
Open Graph Title: node --watch-path: Does not restart when re-creating subdir on Linux · Issue #67592 · nodejs/node
X Title: node --watch-path: Does not restart when re-creating subdir on Linux · Issue #67592 · nodejs/node
Description: Version v26.13.1 Platform Linux ubuntu 7.2.12-orbstack-00394-gbecdd6130068 #1 SMP PREEMPT Thu Oct 22 22:17:17 UTC 2026 aarch64 GNU/Linux Subsystem No response What steps will reproduce the bug? index.js (a stupid long-running program tha...
Open Graph Description: Version v26.13.1 Platform Linux ubuntu 7.2.12-orbstack-00394-gbecdd6130068 #1 SMP PREEMPT Thu Oct 22 22:17:17 UTC 2026 aarch64 GNU/Linux Subsystem No response What steps will reproduce the bug? ind...
X Description: Version v26.13.1 Platform Linux ubuntu 7.2.12-orbstack-00394-gbecdd6130068 #1 SMP PREEMPT Thu Oct 22 22:17:17 UTC 2026 aarch64 GNU/Linux Subsystem No response What steps will reproduce the bug? ind...
Opengraph URL: https://github.com/nodejs/node/issues/67592
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"node --watch-path: Does not restart when re-creating subdir on Linux","articleBody":"### Version\n\nv26.13.1\n\n### Platform\n\n```text\nLinux ubuntu 7.2.12-orbstack-00394-gbecdd6130068 #1 SMP PREEMPT Thu Oct 22 22:17:17 UTC 2026 aarch64 GNU/Linux\n```\n\n### Subsystem\n\n_No response_\n\n### What steps will reproduce the bug?\n\nindex.js (a stupid long-running program that can be restarted with `--watch`):\n\n```js\nconsole.log(new Date);\nprocess.stdin.resume();\n```\n\ngenerate.js (some kind of code generation script):\n\n```js\nimport fs from \"fs\";\n\n// Clear generated folder:\nfs.rmSync(\"assets/generated\", { recursive: true, force: true });\nfs.mkdirSync(\"assets/generated\", { recursive: true });\n\n// Generate files:\nfs.writeFileSync(\"assets/generated/a.txt\", `${Date.now()}`);\n```\n\nRun in one terminal: `node --watch-path assets --watch-preserve-output index.js`\n\nRun in another terminal: `node generate.js` (multiple times)\n\n### How often does it reproduce? Is there a required condition?\n\nAlways.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nOutput on macOS:\n\n```\n❯ node --watch-path assets --watch-preserve-output index.js\n2026-11-18T19:13:55.414Z\nChange detected in '/Users/me/stuff/node-watch-bug-linux/assets/generated/a.txt'\nRestarting 'index.js'\n2026-11-18T19:13:59.098Z\nChange detected in '/Users/me/stuff/node-watch-bug-linux/assets/generated/a.txt'\nRestarting 'index.js'\n2026-11-18T19:14:00.181Z\nChange detected in '/Users/me/stuff/node-watch-bug-linux/assets/generated/a.txt'\nRestarting 'index.js'\n2026-11-18T19:14:01.155Z\n```\n\nI ran `generate.js` three times, and it restarted three times as expected.\n\n### What do you see instead?\n\nOutput on Linux:\n\n```\n$ node --watch-path assets --watch-preserve-output index.js\n2026-11-18T19:12:31.961Z\nChange detected in '/mnt/e/node-watch-bug-linux/assets/generated/a.txt'\nRestarting 'index.js'\n2026-11-18T19:12:39.721Z\n```\n\nThere is just one restart, even though I ran `generate.js` three times. I expected three restarts.\n\n### Additional information\n\nI think it’s common to nuke a folder and recreate it before generating things.\n\nI reproduced this in a Linux Virtual Machine (via OrbStack on macOS) with ext4 file system (no mounting into the macOS file system), but I’m pretty sure the same thing happens on a real Linux machine as well.","author":{"url":"https://github.com/lydell","@type":"Person","name":"lydell"},"datePublished":"2026-11-18T19:21:00Z","url":"https://github.com/nodejs/node/issues/67592"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:445c3595-c4fb-c443-15cf-25ce761ea449 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 997C:30F58B:2FE758:3F2DFF:6B06166B |
| html-safe-nonce | 2e98d53ef0297ef4406b4a81a8f366f8a3928578a32053c3e0f7ea632c3a87ed |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTdDOjMwRjU4QjoyRkU3NTg6M0YyREZGOjZCMDYxNjZCIiwidmlzaXRvcl9pZCI6IjYxODc0OTcxMzg3MzQ2MzQ2MDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d1a13896c70b0e9b544ce818eca4cd4d258bcab9100167aa423b89fbc317c5de |
| hovercard-subject-tag | issue:6474911023 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/67592/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2f9b6ec508c153e4de6dc0846f1f0fbfb4b9c46198012075d798e0780c346c8b/nodejs/node/issues/67592 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2f9b6ec508c153e4de6dc0846f1f0fbfb4b9c46198012075d798e0780c346c8b/nodejs/node/issues/67592 |
| og:image:alt | Version v26.13.1 Platform Linux ubuntu 7.2.12-orbstack-00394-gbecdd6130068 #1 SMP PREEMPT Thu Oct 22 22:17:17 UTC 2026 aarch64 GNU/Linux Subsystem No response What steps will reproduce the bug? ind... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lydell |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width