nodejs / nodejs/node

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

Ouverte
#60,594 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

stale watch-mode
Langage dominant
JavaScript
Étoiles
122k
Forks
37.3k
Merge moyen
4 j 2 h
PR mergées (30 j)
283

Description

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.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par exécuter la commande de reproduction Windows et examinez comment process.execArgv gère les options --watch et --watch-path avant le nom du script. Le correctif est terminé lorsque les deux formes d’option et leurs valeurs apparaissent dans process.execArgv comme indiqué dans la sortie attendue, tout en préservant le comportement des trois commandes fournies.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, node.js
Domaine
operating-systems
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
55/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.