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 upgrade-interactive not finding outdated #4439

Closed
chrisblossom opened this issue Sep 13, 2017 · 5 comments
Closed

yarn upgrade-interactive not finding outdated #4439

chrisblossom opened this issue Sep 13, 2017 · 5 comments

Comments

@chrisblossom
Copy link

chrisblossom commented Sep 13, 2017

Do you want to request a feature or report a bug?
bug
Related issues: #4390 #2042

What is the current behavior?

➜  yarn-issue-4439 yarn upgrade-interactive
yarn upgrade-interactive v1.0.1
warning ../../package.json: No license field
success All of your dependencies are up to date.
✨  Done in 0.25s.
➜  yarn-issue-4439 yarn outdated
yarn outdated v1.0.1
warning ../../package.json: No license field
Package   Current Wanted Latest Package Type URL
gzip-size 3.0.0   3.0.0. 4.0.0  dependencies https://github.com/sindresorhus/gzip-size#readme
✨  Done in 0.27s.

If the current behavior is a bug, please provide the steps to reproduce.

➜  yarn-issue-4439 npm init -y
Wrote to /Users/chris/github/yarn-issue-4439/package.json:

{
  "name": "yarn-issue-4439",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}


➜  yarn-issue-4439 npm install --save gzip-size@3
yarn-issue-4439@1.0.0 /Users/chris/github/yarn-issue-4439
└─┬ gzip-size@3.0.0
  └── duplexer@0.1.1

npm WARN yarn-issue-4439@1.0.0 No description
npm WARN yarn-issue-4439@1.0.0 No repository field.
➜  yarn-issue-4439 rm -rf node_modules
➜  yarn-issue-4439 yarn
yarn install v1.0.1
warning ../../package.json: No license field
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
✨  Done in 0.48s.
➜  yarn-issue-4439 ls
node_modules package.json yarn.lock
➜  yarn-issue-4439 yarn upgrade-interactive
yarn upgrade-interactive v1.0.1
warning ../../package.json: No license field
success All of your dependencies are up to date.
✨  Done in 0.25s.
➜  yarn-issue-4439 yarn outdated
yarn outdated v1.0.1
warning ../../package.json: No license field
Package   Current Wanted Latest Package Type URL
gzip-size 3.0.0   3.0.0. 4.0.0  dependencies https://github.com/sindresorhus/gzip-size#readme
✨  Done in 0.27s.

Example Repo: https://github.com/chrisblossom/yarn-issue-4439

What is the expected behavior?
yarn upgrade-interactive menu pops up.

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

yarn 1.0.1
node 6.11.3
osx 10.12.6
npm 3.10.10
@screendriver
Copy link

Same here with Yarn 1.0.2. yarn outdated shows me some outdated dependencies but yarn upgrade-interactive shows nothing.

@screendriver
Copy link

I found the solution in #4390. Since Yarn 1.0.0 it respects the versions in package.json. Since I have there fixed version numbers ("glamorous": "4.9.1" instead of "glamorous": "^4.9.1") I have to pass --latest to Yarn: yarn upgrade-interactive -E --latest

Maybe this can help you @chrisblossom

@rally25rs
Copy link
Contributor

With v1.0 we changed the way that yarn upgrade and yarn upgrade {package_name} and yarn upgrade-interactive work. Before they all would chose different versions to upgrade to.

Now all 3 of those commands respect the version range in package.json, so upgrade-interactive is looking for a newer ~3.0.0 version (and not finding one).

As @screendriver mentioned, passing the -L/--latest flag will tell upgrade-interactive to ignore the package.json specified range and use the latest as specified by the registry.

There is some additional documentation and intent behind this change here: https://github.com/yarnpkg/rfcs/blob/master/implemented/0000-upgrade-command-consistency.md
we also intentionally did this for v1.0.0 as we deemed it OK to have some "breaking" changes between v0.x and v1.x if it was to overall make Yarn easier to use and more consistent.

I am going to close this issue since this is as-designed for v1 (though in hind sight we should probably have better documented this as a "breaking change" and I apologize for that shortcoming)

@maximeg
Copy link

maximeg commented Oct 4, 2017

@rally25rs sorry to hijack the ticket, but I have a question related to your explanation.
before, when running yarn upgrade, the sub-dependancies were upgraded (according to versions constraints of dependancies). And since 1.0, this doesn't work anymore.
How can we do that now ?

publicarray added a commit to publicarray/update that referenced this issue Feb 17, 2018
@nfarina
Copy link

nfarina commented May 21, 2020

Just want to empathize with anyone else landing on this issue—I had no idea about --latest until about 5 minutes ago, and now I have nearly 100 packages to do major version upgrades on. This will be fun…

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

5 participants