Yarn Berry is detected after Yarn Classic is installed, so Berry projects fail at yarn --version --loglevel notice
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go, node.js
- Lĩnh vực
- build-system
Hướng nghiên cứu
Start in src/nodejs/supply/supply.go, tracing the order of Run(), ReadPackageJSON(), and the UsesYarnBerry check. Find the existing unit-test setup for Yarn installation and add a case with .yarnrc.yml that verifies InstallYarnBerry() is called, not InstallYarn(); run the relevant Go tests. Done means Berry is selected before installation for Berry projects.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened
A Yarn 4 project (yarn.lock, .yarnrc.yml with yarnPath, and packageManager: [email protected]) fails during supply on v1.9.6. The buildpack installs Yarn Classic 1.22.22 instead of yarn-berry, then runs yarn --version --loglevel notice. Classic hands off to the project's Yarn 4 release through yarnPath, and Yarn 4 rejects the option:
Unknown Syntax Error: Unsupported option name ("--loglevel").
Cause
In src/nodejs/supply/supply.go, Run() chooses between InstallYarnBerry() and InstallYarn() based on s.UsesYarnBerry (around line 136). That flag is only set later, inside ReadPackageJSON() (called around line 158), where .yarnrc.yml is detected (around line 444). When the install choice is made, UsesYarnBerry is always false, so Berry projects always get Classic. The same ordering is on master and v1.9.7.
Removing yarnPath gets past the version check, but Build() then calls buildBerry() with Classic on PATH. Classic refuses to run because packageManager pins Yarn 4.
Suggested fix
Detect yarn.lock and .yarnrc.yml before the Yarn install step. For example, move that detection out of ReadPackageJSON() into a step that runs before the UsesYarnBerry check in Run(), or call ReadPackageJSON() before installing the package manager. A unit test where .yarnrc.yml is present should check that InstallYarnBerry() is called and InstallYarn() is not.
Environment
- Buildpack: v1.9.6 (same code in v1.9.7 and
master) - Stack: cflinuxfs4
- Yarn: 4.18.1,
nodeLinker: node-modules
- Ngôn ngữ chính
- Go
- Star
- 174
- Fork
- 390
- Merge trung bình
- 15 giờ 51 phút
- Pull request đã merge (30 ngày)
- 21
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc 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 cloudfoundry/nodejs-buildpack
-
unscheduled
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
cloudfoundry/nodejs-buildpack#683 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
cloudfoundry/nodejs-buildpack#997 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 54/100
cloudfoundry/nodejs-buildpack#985 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
cloudfoundry/nodejs-buildpack#978 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Misleading "PRO TIP" about missing "package-lock.json" (with `npm-shrinkwrap.json`)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
cloudfoundry/nodejs-buildpack#852 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cloudfoundry/nodejs-buildpack
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
github/github-mcp-server#3865 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
kind/features
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
TencentBlueKing/bk-nodemgr#4017 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ssa: wait errors drop the kstatus message, so health check failures don't say whyCó thể đã có người làm @schdief đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
equinor/radix-operator#2066 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
microsoft/terraform-provider-msgraph#188 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày