Corepack incorrectly selects prerelease/dev versions of pnpm when no version is specified
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
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- nodejs, typescript
Hướng nghiên cứu
Bắt đầu bằng cách lần theo đường dẫn phân giải của corepack use pnpm và cách nó đọc package.json của pnpm; tái hiện hành vi này với môi trường Node.js 20, Corepack 0.34.4 và Alpine được mô tả ở đây. Được xem là hoàn tất khi một yêu cầu pnpm không được chỉ định chọn bản phát hành ổn định mới nhất và sử dụng đường dẫn entry binary hiện tại của nó thay vì một đường dẫn legacy được hardcode.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
After some discussion on the pnpm issue (https://github.com/pnpm/pnpm/issues/10214), it turns out the problem is not caused by a faulty pnpm release, pnpm v11 has changed its binary entry path from bin/pnpm.cjs to bin/pnpm.mjs., so the development build 11.0.0-dev.1005 is not faulty. Corepack is expecting the old path and fails.
So the issue appears to be:
- Corepack’s version resolution prefers a dev build over the latest stable
- Corepack seems to rely on a hardcoded pnpm binary path instead of reading the correct bin path from package.json.
As a workaround I'm currently using
corepack use pnpm@10.22.0orcorepack use pnpm@latest(or latest-9, latest-10 etc.)Leaving this update here so the root cause is clearer.
Originally posted by @tkesici in #772
Problem
When running corepack use pnpm, Corepack unexpectedly selects and installs a prerelease development build of pnpm (11.0.0-dev.1005) instead of the latest stable version .
This leads to failure because pnpm v11 is not stable yet and its structure differs from the current pnpm 10.x series.
Expected Behavior
If no version is specified, Corepack should prefer the latest stable release of pnpm (e.g 10.x)
Actual Behavior
corepack use pnpm resolves to: Installing pnpm@11.0.0-dev.1005...
Environment
Node.js: 20 (node:20-alpine)
Corepack: 0.34.4
OS: Alpine Linux
- Ngôn ngữ chính
- TypeScript
- Star
- 3.8k
- Fork
- 279
- Merge trung bình
- 1 giờ 47 phút
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nodejs/corepack
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Tất cả issue của nodejs/corepack
Issue tương tự
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100