[BUG] Yarn 4 via Corepack fails — environment ships Yarn 1.22.22, network sandbox blocks Corepack download

Resolved 💬 3 comments Opened Mar 27, 2026 by ForestSpark Closed Apr 27, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Projects using Yarn 4+ with the standard packageManager field in package.json cannot run yarn install in the Claude Code web environment. The globally installed Yarn 1.22.22 refuses to run because it detects the packageManager field requires Yarn 4. Running corepack enable succeeds, but Corepack cannot download the Yarn 4 binary because the network sandbox blocks the request to repo.yarnpkg.com with a 403 proxy error.

This is a complete blocker — yarn install, yarn build, yarn test, etc. all fail. No JavaScript dependency management is possible.

What Should Happen?

Corepack should be able to download and use the Yarn version specified in the project's packageManager field, or Yarn 4 should be pre-installed in the environment alongside Yarn Classic.

Error Messages/Logs

# Step 1: Running yarn install
error This project's package.json defines "packageManager": "yarn@4.12.0". However the current global version of Yarn is 1.22.22.

Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal.

# Step 2: After running corepack enable, then yarn --version
! Corepack is about to download https://repo.yarnpkg.com/4.12.0/packages/yarnpkg-cli/bin/yarn.js
Error: Error when performing the request to https://repo.yarnpkg.com/4.12.0/packages/yarnpkg-cli/bin/yarn.js; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting
    at fetch (/opt/node22/lib/node_modules/corepack/dist/lib/corepack.cjs:22051:11)
  [cause]: TypeError: fetch failed
    cause: RequestAbortedError [AbortError]: Proxy response (403) !== 200 when HTTP Tunneling

Steps to Reproduce

  1. Open any project in Claude Code (web) that has a packageManager field in package.json specifying Yarn 4+, e.g.:

```json
{
"packageManager": "yarn@4.12.0"
}

  1. Run yarn install
  2. Observe error about global Yarn version mismatch
  3. Run corepack enable
  4. Run yarn --version
  5. Observe 403 proxy error — Corepack cannot download Yarn 4 binary

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude Code web environment (March 2026)

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

Possible solutions

  1. Allow repo.yarnpkg.com through the network sandbox so Corepack can download the requested Yarn version
  2. Pre-install Yarn 4 alongside Yarn Classic in the environment
  3. Support Corepack out of the box — run corepack enable and pre-cache common package manager versions

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗