Skip to content

Instantly share code, notes, and snippets.

@kenmori
Last active April 14, 2026 14:23
Show Gist options
  • Select an option

  • Save kenmori/2b31d0cde603751cf92afe2e2bb20263 to your computer and use it in GitHub Desktop.

Select an option

Save kenmori/2b31d0cde603751cf92afe2e2bb20263 to your computer and use it in GitHub Desktop.
error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`

error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.

if you update your package.json only. and then run yarn install --frozen-lockfile

The above error show you on console.

it's say that you need to run just yarn install.

--fronzen-lockfile option is tell you need to update your lock.file which will be much dependency of package in your package.json.

It's possible to occure in server when you deploy. if there are your changed package.json that pushing to git repogitory already in server , But you forget to change yarn.lockfile and have not been git it, run above command (--forzen-lockfile). you notice that your forgot it.

@m3hari

m3hari commented Dec 1, 2020

Copy link
Copy Markdown

Thanks!

@hcooch2ch3

Copy link
Copy Markdown

thanks!

@VitorTS

VitorTS commented Aug 12, 2021

Copy link
Copy Markdown

どうも!

@vtereshyn

Copy link
Copy Markdown

frozen, fronzen or forzen? a lot of typo in such small text

@nik-neg

nik-neg commented Sep 1, 2021

Copy link
Copy Markdown

In my case the issue was resolved with the following:

I removed the yarn.lock file and continued to work with npm.
Because they use a default "yarn install --frozen-lockfile" command if both files package.json and yarn.lock are present in the folder
as described in the links below.

https://changelog.travis-ci.com/detect-use-of-yarn-lock-file-with-node-js-138600

https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#using-yarn

@turbodog03

Copy link
Copy Markdown

thank you!It helped me a lot. I use yarn adding the packages that npm installed before, and now it works well.

@brianpooe

Copy link
Copy Markdown

Thanks.

@El-Buen-Alex

Copy link
Copy Markdown

Gracias!

@AlvaroBarroso

Copy link
Copy Markdown

Try:
export NODE_OPTIONS=--openssl-legacy-provider

@vladpavlovski

Copy link
Copy Markdown

Thank you!

@Gonzalo-Bruna

Copy link
Copy Markdown

thank you it helped me a lot!

@jeffkershner

Copy link
Copy Markdown

Thank you!

@ajoslin103

Copy link
Copy Markdown

in order to get my project going again I had to use yarn 1

I installed corepack (suggested from the [deprecated] yarn version manager)

made sure I had entries in my package.json (and deleted a .yarnrc file asking for yarn 3)

  "packageManager": "yarn@1.22.19",
  "engines": {
    "node": ">=14.19 <=16.x",
    "yarn": "=1.22.19"
  },

Then activated the yarn I wanted

corepack prepare yarn@1.22.19 --activate

and then everything worked again

@keshu6598

Copy link
Copy Markdown

I also got this error in my build pipeline, just removing the ^ from dependency helped to solve the issue.

@irvingvjuarez

Copy link
Copy Markdown

I had a problem deploying a backend app in railway and I solved doing two things:

  • Removing the ^ from the dependencies
  • Deleting the yarn.lock file, since it was generated on the build process and therefore, this error didn't appeared anymore

@MakStashkevich

Copy link
Copy Markdown

Thanks!

@flashjames

Copy link
Copy Markdown

I had a problem deploying a backend app in railway and I solved doing two things:

* Removing the ^ from the dependencies

* Deleting the yarn.lock file, since it was generated on the build process and therefore, this error didn't appeared anymore

Thank you!

@nathantew14

Copy link
Copy Markdown

I had a problem deploying a backend app in railway and I solved doing two things:

  • Removing the ^ from the dependencies
  • Deleting the yarn.lock file, since it was generated on the build process and therefore, this error didn't appeared anymore

@irvingvjuarez can I ask where you deleted the yarn.lock file from?

@milanmajchrak

Copy link
Copy Markdown

Thanks!

@chris-activewrite

Copy link
Copy Markdown

@nik-neg you said:

if both files package.json and yarn.lock are present

I think you meant if both files package-lock.json and yarn.lock are present, right?

@benardelia

Copy link
Copy Markdown

this solve my issue thanks

@asrinivas61

Copy link
Copy Markdown

I had a problem deploying a backend app in railway and I solved doing two things:

  • Removing the ^ from the dependencies
  • Deleting the yarn.lock file, since it was generated on the build process and therefore, this error didn't appeared anymore

It worked, Thanks!

@taniarv

taniarv commented Jul 22, 2025

Copy link
Copy Markdown

I had a problem deploying a backend app in railway and I solved doing two things:

* Removing the ^ from the dependencies

* Deleting the yarn.lock file, since it was generated on the build process and therefore, this error didn't appeared anymore

Yes, it works! Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment