nodejs / nodejs/node

`process.execArgv` does not include `--watch` or `--watch-path` options or their values on Windows

Offen
#60,594 6 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

stale watch-mode
Vorherrschende Sprache
JavaScript
Sterne
122k
Forks
37.3k
Ø Merge
4 T. 2 Std.
Gemergte PRs (30 T.)
283

Beschreibung

Version

v24.11.0

Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem

process

What steps will reproduce the bug?
  1. Create a build.js file:
/** @file build.js */
import { execArgv } from "node:process";
console.warn(execArgv);
  1. Create an empty file named template.html (content does not matter).

  2. Run the following command:

(node --watch-path=template.html build.js & node --watch-path template.html build.js & node --watch build.js) > /dev/null
How often does it reproduce? Is there a required condition?

Always reproducible when --watch or --watch-path options are specified on the node command line.

What is the expected behavior? Why is that the expected behavior?

Expected output:

[ '--watch-path=template.html' ]
[ '--watch-path', 'template.html' ]
[ '--watch' ]

According to Node.js documentation, process.execArgv should contain the Node options passed before the script name.

What do you see instead?
[]
[]
[]
Additional information

Bash is installed on my Windows system. I used it in the reproduction steps because it makes it easier to chain blocking commands and run them in the background compared to PowerShell or Command Prompt.
Press Ctrl+C to terminate all background processes at once.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, den Windows-Reproduktionsbefehl auszuführen und zu untersuchen, wie process.execArgv die Optionen --watch und --watch-path vor dem Skriptnamen verarbeitet. Die Korrektur ist vollständig, wenn beide Optionsformen und ihre Werte wie in der erwarteten Ausgabe in process.execArgv erscheinen und dabei das Verhalten für die drei bereitgestellten Befehle erhalten bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, node.js
Bereich
operating-systems
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.