Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Ctrl+C leaves `cf dev` stuck at "Terminate batch job (Y/N)?" on Windows in npm projects

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

Maintainer thường phản hồi trong vòng 1 ngày

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

  • #413 của @Cherry — đã đóng, không merge

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
node.js, typescript
Lĩnh vực
cli, developer-experience

Hướng nghiên cứu

The report describes cf dev and cf build launching npm.cmd or npx.cmd through cmd.exe on Windows; no source files or tests are named. Start by tracing how the CLI resolves and launches these commands, then reproduce Ctrl+C in an npm project on Windows. Done means the server stops and cf exits without the batch-job prompt; the linked pull request indicates this work is already under way.

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

Mô tả

Summary of the issue

On Windows, when cf dev or cf build runs the framework through npm (for example npx astro dev), pressing Ctrl+C stops the dev server but cf doesn't exit. The terminal shows cmd's Terminate batch job (Y/N)? and waits for an answer.

cf resolves npm/npx to the npm.cmd/npx.cmd that ship with Node and runs them through cmd.exe. Unlike the cmd-shim launchers in node_modules\.bin, those two don't end the batch context before starting Node, so cmd asks about the interrupted batch file once npm exits. Running npm run dev directly in PowerShell doesn't hit this because PowerShell uses npm.ps1.

pnpm projects show the same prompt from pnpm's own node_modules\.bin\*.cmd shims, which is outside cf.

Expected behaviour

Ctrl+C stops the dev server and cf exits, the same as on macOS and Linux, and the same as running npm run dev yourself in PowerShell.

Version of cf used

1.0.0-beta.21

System information and package versions

System:
OS: Windows 11 10.0.26300
CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
Memory: 8.60 GB / 31.91 GB
Binaries:
Node: 26.12.0
npm: 11.18.0
pnpm: 12.14.0

Reproduction (optional)

In PowerShell or Windows Terminal, in an npm project cf runs through npx (for example Astro):

cf dev
# wait for the dev server, then press Ctrl+C

The dev server shuts down, then Terminate batch job (Y/N)? appears and cf keeps running until you answer it.

Relevant error logs (optional)
│  Delegating to npx astro dev
...
Terminate batch job (Y/N)?

Fix: https://github.com/cloudflare/cf/pull/413

Ngôn ngữ chính
TypeScript
Star
916
Fork
53
Merge trung bình
23 giờ 30 phút
Pull request đã merge (30 ngày)
216

Chuẩn bị môi trường

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.

Issue khác của cloudflare/cf

Tất cả issue của cloudflare/cf

Issue tương tự

Thêm issue về TypeScript

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.