Yarn install error while deploying to Vercel

I made a fresh project and tried to deploy to vercel by following the documentation at Deploy to Vercel | RedwoodJS Docs which resulted in this error
Error: Command "yarn install" exited with 1.

[15:15:26.215] Running build in Washington, D.C., USA (East) – iad1
[15:15:27.836] Cloning github.com/aidankmcalister/musician-booking-app (Branch: main, Commit: ed698b9)
[15:15:28.241] Previous build cache not available
[15:15:28.697] Cloning completed: 857.802ms
[15:15:29.390] Running "vercel build"
[15:15:30.496] Vercel CLI 33.6.1
[15:15:33.527] Installing dependencies...
[15:15:35.587] ➤ YN0000: · Yarn 4.1.0
[15:15:35.610] ➤ YN0000: ┌ Resolution step
[15:16:20.183] ➤ YN0085: │ + fsevents@patch:fsevents@npm%3A1.2.13#optional!builtin<compat/fsevents>::version=1.2.13&hash=d11327, and 4 more.
[15:16:20.185] ➤ YN0085: │ - fsevents@patch:fsevents@npm%3A1.2.13#~builtin<compat/fsevents>::version=1.2.13&hash=d11327, and 4 more.
[15:16:20.253] ➤ YN0000: └ Completed in 44s 643ms
[15:16:20.392] ➤ YN0000: ┌ Post-resolution validation
[15:16:20.393] ➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.
[15:16:20.393] ➤ YN0000: └ Completed
[15:16:20.393] ➤ YN0000: · Failed with errors in 44s 806ms
[15:16:20.496] Error: Command "yarn install" exited with 1

Hi @aidankmcalister and thanks for trying our RedwoodJS.

I confess I haven’t deployed to Vercel in a little bit and haven’t seen this error before that I can recall – so I’ll ask the team.

Might you have a repo we can refer to or try out in order to reproduce?


Hey @dthyresson!

Here’s a test repo. The only thing that’s been done to it is yarn rw deploy vercel.

Hey @aidankmcalister

Sorry for the trouble. – I just did a fresh install of Redwood and then tried deploying to Vercel. Initially, I hit an error, but it resolved as soon as I added ENABLE_EXPERIMENTAL_COREPACK=1 as an environmental variable.

Check out this issue: [Bug?]: initial deploy to Vercel not working with latest (rw 7.0.6, node 20) · Issue #10100 · redwoodjs/redwood · GitHub

Does that fix it?

I just created a new project and it isn’t working for me. These are the steps I took

Created new project

✔ Select your preferred language · TypeScript
✔ Do you want to initialize a git repo? · no / Yes
✔ Enter a commit message · Initial commit
✔ Do you want to run yarn install? · no / Yes

Then ran yarn rw deploy vercel successfully.

I put ENABLE_EXPERIMENTAL_COREPACK=1 as an environmental variable.

Failed with Error: Command "yarn install" exited with 1.

With the environment variable, it fails after about a minute instead of 5 seconds.

Here’s the new repo for this one in case you need it.

@aidankmcalister Try deleting your yarn.lock file, running yarn install and recommitting the yarn.lock file to your repo.

I cloned your repo, tried deploying to Vercel, saw the same error message you’re getting, ran these steps, and was able to successfully deploy:

That worked! It failed the first time but I was on an older version of yarn. So once I updated that it deployed.

1 Like

Glad it’s working @aidankmcalister and many thanks @ahaywood for these tips!

1 Like