Yarn Berry is detected after Yarn Classic is installed, so Berry projects fail at yarn --version --loglevel notice
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 74/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- go, node.js
- Domínio
- build-system
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Go
- Estrelas
- 174
- Forks
- 390
- Merge médio
- 15h 51min
- PRs com merge (30d)
- 21
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de cloudfoundry/nodejs-buildpack
-
unscheduled
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 62/100
cloudfoundry/nodejs-buildpack#683 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 57/100
cloudfoundry/nodejs-buildpack#997 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 54/100
cloudfoundry/nodejs-buildpack#985 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
cloudfoundry/nodejs-buildpack#978 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Misleading "PRO TIP" about missing "package-lock.json" (with `npm-shrinkwrap.json`)Talvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 48/100
cloudfoundry/nodejs-buildpack#852 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de cloudfoundry/nodejs-buildpack
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
github/github-mcp-server#3865 ·
Mantenedores costumam responder em até 2 dias
-
kind/features
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
TencentBlueKing/bk-nodemgr#4017 ·
Mantenedores costumam responder em até 1 dia
-
ssa: wait errors drop the kstatus message, so health check failures don't say whyTalvez já em andamento @schdief assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
equinor/radix-operator#2066 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
microsoft/terraform-provider-msgraph#188 · 1 reação ·
Mantenedores costumam responder em até 1 dia