-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 install --force
not overwriting yarn.lock when --frozen-lockfile true
set in .yarnrc
#4570
Comments
We ran into this again. Could you please provide any feedback if this will be fixed or if there is a working workaround that both allows for frozen-lockfile setting as a default but also allows for adding new dependencies? |
I have deleted the
Instead, I now ensure that the |
I too would like to add it would be nice if i could run |
@k0pernikus @stringbeans I found a workaround, if your run this command Full demo: $ git status yarn.lock
...
nothing to commit, working tree clean
$ cat .yarnrc
--frozen-lockfile true
$ yarn install
....
error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.
$ yarn install --force
......
✨ Done in 54.34s.
$ git status yarn.lock
.....
nothing to commit, working tree clean
$ yarn install --no-default-rc
...
success Saved lockfile.
✨ Done in 53.23s.
$ git status yarn.lock
...
modified: yarn.lock
... |
To expand on @olegserov workaround, it only works if one does not need a
For my projects, the workaround is not feasible as they require a private registry setting provided through the |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
yarn install --force
is not overwritingyarn.lock
Add
.yarnrc
:Edit package.json and add another dependency to get package.json and yarn.lock out of sync.
Run
Example repository: https://github.com/k0pernikus/yarn-bug-install-force
What is the expected behavior?
yarn install --force
should overwrite the lockfile as stated in the help: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 theyarn.lock
file do not match. That's why I runforce
to begin with. Yet I have to temporarily remove the.yarnrc
config. Then I can just runyarn install
to get an updatedyarn.lock
file and theforce
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
The text was updated successfully, but these errors were encountered: