YARN - How to generate yarn.lock How do i generate the yarn.lock file for my existing project?
The yarn.lock file is automatically generated/updated when you install package(s). To my knowledge anyway.
Exactly right.. just run yarn install (or even just yarn as it will default to install..) and it'll create the lockfile if it doesn't already exist.
It did the first time I ran it. Then I deleted the lock file and from then on yarn kept complaining about the missing file but did not generate it again.
delete the node_modules dir and run yarn install again. Commit the yarn.lock to your repo, and don't delete it again :)
Please sign in or create an account to participate in this conversation.