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

pnpm 11: workspace pkg building via a sibling workspace CLI bin fails (bin never linked)

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

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
github-actions
Lĩnh vực
build-system, ci-cd

Hướng nghiên cứu

Bắt đầu với các workflow có thể tái sử dụng có tên preview.yml và publish.yml, sau đó tái hiện chuỗi pnpm 11.18.0 bằng một pnpm install && pnpm run build mới. So sánh hành vi với pnpm 10 và các lần chạy preview của clink#43; được xem là hoàn tất khi một package trong workspace có thể gọi thành công một CLI bin của workspace anh em trong quá trình build workflow.

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

Mô tả

Problem

Repos using the reusable build workflows (preview.yml, publish.yml) run pnpm install followed by pnpm run build. In a self-hosting monorepo where one workspace package's build script invokes another workspace package's bin — e.g. an example whose build is clink build, where clink's bin is ./dist/bin.js — the build step fails under pnpm 11:

examples/basic build: sh: clink: command not found
[ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL] @example/basic@ build: `clink build`
[ELIFECYCLE] Command failed with exit code 1.
Why

At pnpm install time the CLI package has not been built yet, so its bin target (packages/<cli>/dist/bin.js) doesn't exist. pnpm 11 refuses to create the .bin/<cli> symlink for a missing target and only warns:

[WARN] Failed to create bin at .../examples/basic/node_modules/.bin/clink.
ENOENT: no such file or directory, open '.../packages/clink/dist/bin.js'

The subsequent pnpm run build builds the CLI (topological order), but the bin is never relinked. pnpm appears to cache "no bin" from the first resolution: after the CLI is built, neither a plain pnpm install nor pnpm install --force recreates the symlink — both report Already up to date and skip linking. So every downstream package that shells out to the CLI bin fails.

This differs from pnpm 10, where the install→build sequence in these workflows worked.

Impact

Any repo on these workflows with a workspace package that builds by invoking a sibling workspace bin. It's latent — CI only hits it once the install+build path actually runs to the dependent packages.

Repro
  • pnpm 11.18.0, fresh pnpm install && pnpm run build.
  • Concrete instance: bombshell-dev/clink#43 (see the preview runs on that PR before the workaround commit).
Ngôn ngữ chính
TypeScript
Star
4
Fork
1
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 bombshell-dev/automation

Tất cả issue của bombshell-dev/automation

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.