Skip to content

yarn install --force not overwriting yarn.lock when --frozen-lockfile true set in .yarnrc #4570

@k0pernikus

Description

@k0pernikus

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

Bug

What is the current behavior?

yarn install --force is not overwriting yarn.lock

yarn init
yarn add lodash

Add .yarnrc:

--frozen-lockfile true

Edit package.json and add another dependency to get package.json and yarn.lock out of sync.

Run

yarn install --force

Example repository: https://github.com/k0pernikus/yarn-bug-install-force

yarn install

What is the expected behavior?

yarn install --force should overwrite the lockfile as stated in the help:

--force    install and build packages even if they were built before, overwrite lockfile

My goal is to get an updated yarn.lock file.

Yet the yarn.lock is not touched AND all the dependencies as pointed out in the package.json are installed locally.

I know the package.json and the yarn.lock file do not match. That's why I run force to begin with. Yet I have to temporarily remove the .yarnrc config. Then I can just run yarn install to get an updated yarn.lock file and the force flag becomes needless and misleading.

A developer will get a working state on their machine, yet it will lead to error on the build system and it's hard for them to know why.

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

node v8.4.0
yarn 1.1.0
Ubuntu 16.04

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions