Failed to resolve version 1.22.22 of yarn
mickythompson
FREEOP

4 months ago

Today, when deploying NextJS from within a Yarn 1.22.22 Monorepo, I started experiencing this error:

Failed to resolve version 1.22.22 of yarn

I also tested 1.22.19 and same error:

Failed to resolve version 1.22.19 of yarn

This issue started this morning. Do you know if something changed, or if I need to handle this specially?

Project ID: 02925e76-7600-48bc-99ec-42b7230f0079

[Region: us-east4]
╭────────────────╮
│ Railpack 0.2.3 │
╰────────────────╯
↳ Detected Node
↳ Using yarn1 package manager
↳ Found workspace with 8 packages
↳ Installing yarn@1.22.22 with Corepack
✖ Failed to resolve version 1.22.22 of yarn

5 Replies

prime-cave
HOBBY

4 months ago

I'm currently experiencing the same issue.

╭────────────────╮

│ Railpack 0.2.3 │

╰────────────────╯

↳ Detected Node

↳ Using yarn1 package manager

↳ Installing yarn@1.22.22 with Corepack

Failed to resolve version 1.22.22 of yarn


vacom
HOBBY

4 months ago

I'm having the same problem. I was going to do a new deploy and just ran into this issue. I have the same configs, yarn inside a monorepo with NextJS apps.

╭────────────────╮

│ Railpack 0.2.3 │

╰────────────────╯

↳ Detected Node

↳ Using yarn1 package manager

↳ Found workspace with 12 packages

↳ Installing yarn@1.22.22 with Corepack

Failed to resolve version 1.22.22 of yarn


mickythompson
FREEOP

4 months ago

Thanks to the others posting here to confirm you are experiencing this issue, also. We are still experiencing the problem today with Yarn 1.22.22. We tried to create a new environment, but the error occurs in it, too. To provide more details, we are using Railpack and NextJS web service in a Yarn 1.22.22 monorepo.

Here is the log from August 5, 2025, when Yarn 1.22.22 last worked successfully for this app at Railway. I assume that something changed at Railway or somewhere else on August 6, 2025, to cause this error we are experiencing now.

[Region: us-east4]

╭────────────────╮

│ Railpack 0.2.3 │

╰────────────────╯

↳ Detected Node

↳ Using yarn1 package manager

↳ Found workspace with 8 packages\

↳ Installing yarn@1.22.22 with Corepack

Packages

──────────

node │ 22.14.0 │ .nvmrc (22.14.0)

yarn │ 1.22.22 │ package.json > packageManager (1.22.22)


mickythompson
FREEOP

4 months ago

Someone opened an issue in GitHub documenting this bug:
https://github.com/railwayapp/railpack/issues/210

Also, here is another Railway Station conversation where others are discussing the issue:
https://station.railway.com/questions/build-fails-due-to-failed-to-resolve-ve-8dfcf6e7


mickythompson
FREEOP

4 months ago

Hey! I solved my issue by switching to a Dockerfile approach.

The issue is that Railpack's Corepack is failing to resolve Yarn 1.22.22. While the exact cause it isn't clear, it appears to be related to how Corepack resolves specific Yarn versions -

possibly a compatibility issue or a registry problem.

The Dockerfile solution works because it bypasses Corepack entirely and installs Yarn directly from npm:

# Instead of using Corepack, install Yarn directly via npm

RUN rm -f .yarnrc \

&& rm -f .yarn/releases/yarn-1.22.22.cjs \

&& npm i -g yarn@1.22.22 --force \

&& yarn --version --no-default-rc

Key differences:

1. Direct npm installation: Uses npm i -g yarn@1.22.22, which pulls from the npm registry (where all Yarn versions are available.

2. Removes Yarn config conflicts: Cleans up .yarnrc and any local Yarn releases that might interfere.

3. Uses --no-default-rc: Ensures Yarn ignores any repository-specific configurations that might cause issues

This approach gives you full control over the Yarn installation process and avoids the Corepack version resolution issue entirely. Plus, you get the added benefits of Docker caching and more

predictable builds.

Hope this helps others facing the same issue!


Loading...