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

install --frozen-lockfile --force behaves like --pure-lockfile #5215

Open
torinthiel opened this issue Jan 14, 2018 · 1 comment
Open

install --frozen-lockfile --force behaves like --pure-lockfile #5215

torinthiel opened this issue Jan 14, 2018 · 1 comment
Assignees

Comments

@torinthiel
Copy link

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

What is the current behavior?
Yarn install incorrectly behaves when both --frozen-lockfile and --force are present.

If the current behavior is a bug, please provide the steps to reproduce.
0. Clone https://gist.github.com/1c31682a46ae4ef33f544377003075f7.git

  1. Examine package.json and yarn.lock in this repository. Note that while
    yarn.lock specifies the dependency (lodash used as an example, but the
    exact package is not important) at one version, package.json has the
    dependency version updated.
  2. Run yarn install --frozen-lockfile. Note that it bails out with an error
    that lockfile should be updated.
  3. Run yarn install --frozen-lockfile --force. Note that the command succeeds.
    The version installed in node_modules is different than lockfile specifies,
    but lockfile is not updated. This behaviour is identical as if
    yarn install --pure-lockfile was run at this point.
  4. Finally run yarn install and confirm that lockfile is indeed updated.

What is the expected behavior?
https://yarnpkg.com/en/docs/cli/install says that --frozen-lockfile fails if an update to lockfile is needed. Description of --force does not involve lockfile, only refetching packages. Description of neither --frozen-lockfile nor --force mentions any exception nor possible interactions between those two.Therefore I'd expect yarn install --force --frozen-lockfile to bail out if lockfile is outdated.

Please mention your node.js, yarn and operating system version.

$ node -v 
v8.9.4
$ yarn -v
1.3.2
@rzontar
Copy link

rzontar commented Apr 6, 2020

We run into the same issue on our CI builds, where both --force and --frozen-lockfile parameters are present.

yarn -v
1.22.4

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

No branches or pull requests

3 participants