Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yarn does not always install all required dependencies when lock file is present #2595

Open
robrichard opened this issue Jan 30, 2017 · 2 comments

Comments

@robrichard
Copy link

Not sure if this is intended behavior, but it was confusing to me.

Steps to reproduce

  1. I created a new project using yarn init, and answered with the defaults to each prompt.
  2. Added two dependencies
    -- yarn add lodash.find
    -- yarn add lodash.get
  3. Remove node modules rm -rf node_modules
  4. yarn install
  5. Manually remove one of the dependencies rm -rf node_modules/lodash.get
  6. Running yarn install again says "Already up-to-date." and does not install the missing package

Expected behavior
I would have expected yarn to install the missing lodash.get. We run yarn install on our CI server to run tests on pull requests before they are merged. If one branch causes a dependency to be removed, then another one requires it, yarn install will report success but the build will fail because required dependencies are not installed. I would expect yarn install to always deterministically ensure that every dependency is installed in node_modules

Please mention your node.js, yarn and operating system version.
node v6.9.1, yarn v0.19.1, macOS 10.12.2

Contents of yarn.lock

# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


lodash.find@^4.6.0:
  version "4.6.0"
  resolved "http://npm.intranet.1stdibs.com:4783/lodash.find/-/lodash.find-4.6.0.tgz#cb0704d47ab71789ffa0de8b97dd926fb88b13b1"

lodash.get@^4.4.2:
  version "4.4.2"
  resolved "http://npm.intranet.1stdibs.com:4783/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
@IvanAlegre
Copy link

@robrichard you could use --force

@earnubs
Copy link

earnubs commented Jul 27, 2017

@robrichard from #2240 (comment) try yarn --check-integrity

Also, in the steps to reproduce before step 6 if you use yarn check you will get an error:

$ rm -rf node_modules/lodash.get
$ yarn check
yarn check v0.27.5
error "lodash.get" not installed
error Found 1 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants