Yarn: Not generating yarn.lock file as expected

Created on 16 Nov 2016  ·  3Comments  ·  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
bug

What is the current behavior?
After a successful yarn install if I remove yarn.lock file and run yarn install again it doesn't generate the lockfile.

If the current behavior is a bug, please provide the steps to reproduce.

  • yarn add os-homedir
  • rm yarn.lock
  • yarn install

What is the expected behavior?
It should generate the lockfile

Please mention your node.js, yarn and operating system version.
node v7.1.0
yarn v0.17.2
macOS v10.12.1

cat-bug

All 3 comments

I reproduced this issue with Node.js 4.4.1 and yarn 0.17.2. From reviewing the docs of yarn install, there are only options to _suppress_ yarn.lock being generated, implying that if those options aren't provided, the lockfile is expected to be regenerated.

The workaround is to run yarn add again for the top level dependencies. In this case, yarn add os-homedir. That causes yarn.lock to be re-generated.

I confirmed this is a regression as 0.16.1 does generate the lockfile if it is missing.

Fixed via #1888.

Was this page helpful?
0 / 5 - 0 ratings