Yarn Berry is detected after Yarn Classic is installed, so Berry projects fail at yarn --version --loglevel notice
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 74/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go, node.js
- 領域
- build-system
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Go
- スター
- 174
- フォーク
- 390
- 平均マージ
- 15時間 51分
- マージ済み PR(30日)
- 21
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudfoundry/nodejs-buildpack のほかの issue
-
unscheduled
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
cloudfoundry/nodejs-buildpack#683 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 57/100
cloudfoundry/nodejs-buildpack#997 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 54/100
cloudfoundry/nodejs-buildpack#985 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
cloudfoundry/nodejs-buildpack#978 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Misleading "PRO TIP" about missing "package-lock.json" (with `npm-shrinkwrap.json`)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
cloudfoundry/nodejs-buildpack#852 ·
メンテナーはふだん 1 日以内に返信
cloudfoundry/nodejs-buildpack の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
github/github-mcp-server#3865 ·
メンテナーはふだん 2 日以内に返信
-
kind/features
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
TencentBlueKing/bk-nodemgr#4017 ·
メンテナーはふだん 1 日以内に返信
-
ssa: wait errors drop the kstatus message, so health check failures don't say why対応中かも @schdief が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
equinor/radix-operator#2066 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
microsoft/terraform-provider-msgraph#188 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信