yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.37k stars 2.72k forks source link

yarn upgrade --latest | -L doesn't work #7181

Open desmap opened 5 years ago

desmap commented 5 years ago

Example given: I'm on "react": "^16.8.0-alpha.1", current latest version is 16.8.6, yarn upgrade react -L doesn't do anything.

yarn v1.15.2

Edit: yarn upgrade react@latest works though.

DanielRuf commented 5 years ago

Hi @desmap,

can you provide the commands and outputs that you have got?

I can not reproduce it.


mkdir yarn-react-test
➜  projects cd yarn-react-test 
➜  yarn-react-test yarn init -y
yarn init v1.16.0
warning The yes flag has been set. This will automatically answer yes to all questions, which may have security implications.
success Saved package.json
✨  Done in 0.04s.
➜  yarn-react-test yarn add react@16.8.0-alpha.1 --registry https://registry.npmjs.org
yarn add v1.16.0
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
success Saved 6 new dependencies.
info Direct dependencies
└─ react@16.8.0-alpha.1
info All dependencies
├─ js-tokens@4.0.0
├─ loose-envify@1.4.0
├─ prop-types@15.7.2
├─ react-is@16.8.6
├─ react@16.8.0-alpha.1
└─ scheduler@0.13.6
✨  Done in 0.70s.
➜  yarn-react-test yarn upgrade-interactive --latest
yarn upgrade-interactive v1.16.0
info Color legend : 
 "<red>"    : Major Update backward-incompatible updates 
 "<yellow>" : Minor Update backward-compatible features 
 "<green>"  : Patch Update backward-compatible bug fixes
? Choose which packages to update. (Press <space> to select, <a> to toggle all, <i> to invert selection)
 dependencies
   name   range   from               to      url
❯◯ react  latest  16.8.0-alpha.1  ❯  16.8.6  https://reactjs.org/

➜  yarn-react-test yarn upgrade --latest            
yarn upgrade v1.16.0
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Rebuilding all packages...
success Saved lockfile.
success Saved 5 new dependencies.
info Direct dependencies
└─ react@16.8.6
info All dependencies
...
├─ react@16.8.6
...
✨  Done in 0.63s.
butlersrepos commented 5 years ago

I've seen this same issue when working in a workspaces monorepo, yarn upgrade foo --latest does not update my nested package.json but yarn upgrade foo@latest does.

kumarashwin commented 4 years ago

Can testify; same issue as @butlersrepos. --latest doesn't work in Yarn Workspaces.

EugeneDraitsev commented 4 years ago

@DanielRuf do you have any updates about this issue?

yarn upgrade --latest just stoped to upgrade package.json file. You can reproduce it with this steps:

  1. yarn create react-app
  2. add "@material-ui/core": "^4.5.1" to your dependencies in package.json
  3. run yarn
  4. run yarn upgrade -L or yarn upgrade --latest
  5. check your package.json: @material-ui/core still ^4.5.1 version, but should be ^4.6.0+

yarn version is 1.19.1

kitfit-dave commented 4 years ago

any word on this bug? it certainly still seems to be a bug, yarn 1.22.4

ahuglajbclajep commented 3 years ago

This issue occurs in yarn@1.22.4, regardless of monorepo and workspaces. Until this issue is fixed, it is recommended to use npx npm-check-updates -u instead.

DanielRuf commented 3 years ago

Or try yarn upgrade-interactive --latest.