nodejs / nodejs/node

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

Đang mở
#60,594 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

stale watch-mode
Ngôn ngữ chính
JavaScript
Star
122k
Fork
37.4k
Merge trung bình
4 ngày 3 giờ
Pull request đã merge (30 ngày)
272

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách chạy lệnh tái hiện trên Windows và kiểm tra cách process.execArgv xử lý các tùy chọn --watch và --watch-path trước tên script. Bản sửa được hoàn tất khi cả hai dạng tùy chọn và các giá trị của chúng xuất hiện trong process.execArgv như trong đầu ra mong đợi, đồng thời vẫn giữ nguyên hành vi của ba lệnh được cung cấp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, node.js
Lĩnh vực
operating-systems
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
55/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.