Do you want to request a feature or report a bug? bug
What is the current behavior?
yarn install isn't producing a yarn.lock, thus preventing yarn upgrade
If the current behavior is a bug, please provide the steps to reproduce.
npx create-react-app my-appcd my-appyarn installyarn upgrade
What is the expected behavior?
yarn.lock created when running yarn install
Please mention your node.js, yarn and operating system version.
node: v8.11.1
yarn: 1.6.0
OS: macOS Sierra v10.12.6
I ran into this as well. Right after running yarn install, I don't have a yarn.lock file and I get errors when running commands that need it.
-> yarn why chalk
yarn why v1.5.1
error An unexpected error occurred: "No lockfile in this directory. Run `yarn install` to generate one.".
info If you think this is a bug, please open a bug report with the information provided in ".../yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/why for documentation about this command.
For those who are still stuck on this, running yarn add (for any package) _will_ add the lockfile.
Another option is to create an empty lock-file before running yarn install.
I tried various suggestions with no luck. Then I did this:
rm -rf node_modules <-- blows away your entire node_modules directory
yarn install
A nice, fresh yarn.lock file was the result.
Most helpful comment
Another option is to create an empty lock-file before running yarn install.