[BUG] Yarn 4 via Corepack fails — environment ships Yarn 1.22.22, network sandbox blocks Corepack download
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
- Open any project in Claude Code (web) that has a
packageManagerfield inpackage.jsonspecifying Yarn 4+, e.g.:
```json
{
"packageManager": "yarn@4.12.0"
}
- Run yarn install
- Observe error about global Yarn version mismatch
- Run corepack enable
- Run yarn --version
- 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
- Allow repo.yarnpkg.com through the network sandbox so Corepack can download the requested Yarn version
- Pre-install Yarn 4 alongside Yarn Classic in the environment
- Support Corepack out of the box — run corepack enable and pre-cache common package manager versions
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗