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

[question] what is the difference between yarn install and yarn upgrade #3348

Closed
daprahamian opened this issue May 8, 2017 · 4 comments
Closed

Comments

@daprahamian
Copy link

It seems that yarn install updates dependencies and modifies the lockfile in the same way as yarn upgrade. What is the difference?

@ddgenome
Copy link

ddgenome commented May 8, 2017

What you are seeing might be a bug: #3315

Are versions getting updated or just collapsed/rearranged?

@daprahamian
Copy link
Author

they are getting update.

To give a full overview of my behavior, here are my steps:

  1. Do a clean yarn install
  2. Do a second yarn install to verify that nothing has changed.
  3. Change a dependency in package.json
  4. Run either yarn install or yarn upgrade

I don't necessarily believe this is a bug, since I am not running with --pure-lockfile (and I know there is a discussion over that in #570 ). I'm just trying to clarify what the difference is between yarn install and yarn upgrade? Seems like if they do the same thing, there should be only one command.

@ddgenome
Copy link

If all were working correctly, my understanding is that there is a difference.

yarn or yarn install: if the current yarn.lock file satisfies current package.json, it installs things according to the yarn.lock. If the current yarn.lock does not satisfy the current package.json, upgrade packages and yarn.lock as necessary to satisfy package.json.

yarn upgrade: upgrade all dependencies to the latest versions that satisfy package.json, updating yarn.lock accordingly.

@bestander
Copy link
Member

Sounds right, @ddgenome

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