Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I have this in my package.json
"dependencies": {
"@babel/core": "^7.0.0-beta.46",
}
and this in my yarn.lock
"@babel/core@^7.0.0-beta.46":
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.0.0-beta.47.tgz#b9c164fb9a1e1083f067c236a9da1d7a7d759271"
"@babel/core" "^7.0.0-beta.46"
I see there is a new babel version with yarn info @babel/core versions, the 7.0.0-beta.47, and I want to update my package.json to reflect it, so I run
yarn upgrade-interactive --latest
But the newer babel version doesn't show up in the list!
It's behaving like the command yarn upgrade-interactive, related issue is #4390
Maybe it has something to do with the resolved url in the yarn.lock?
What is the expected behavior?
I want my package.json to be updated
Please mention your node.js, yarn and operating system version.
Node v10.1.0, yarn v1.6.0, OSX
Seems to work for me if I try to reproduce it:
~/Projects/yarn-test2 ๐ yarn
yarn install v1.6.0
[1/4] ๐ Resolving packages...
[2/4] ๐ Fetching packages...
[3/4] ๐ Linking dependencies...
[4/4] ๐ Building fresh packages...
success Saved lockfile.
โจ Done in 3.00s.
~/Projects/yarn-test2 ๐ cat package.json
{
"name": "yarn-test2",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"@babel/core": "^7.0.0-beta.46"
}
}
~/Projects/yarn-test2 ๐ grep @babel/core@ yarn.lock
"@babel/core@^7.0.0-beta.46":
~/Projects/yarn-test2 ๐ yarn upgrade-interactive --latest
yarn upgrade-interactive v1.6.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 inverse selection)
dependencies
name range from to url
โฏโฏ @babel/core latest 7.0.0-beta.46 โฏ 7.0.0-beta.47 https://babeljs.io/
_Edit:_
though if you copy/paste from your lockfile is correct:
"@babel/core@^7.0.0-beta.46":
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.0.0-beta.47.tgz#b9c164fb9a1e1083f067c236a9da1d7a7d759271"
"@babel/core" "^7.0.0-beta.46"
then it resolved to the beta.47.tgz so beta.47 is already installed. What does the version in the lockfile say? You seem to have omitted that line. Should actually look something like:
"@babel/core@^7.0.0-beta.46":
version "????????"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.0.0-beta.47.tgz#b9c164fb9a1e1083f067c236a9da1d7a7d759271"
Thanks for your time @rally25rs!
Here it is with the version:
"@babel/core@^7.0.0-beta.46":
version "7.0.0-beta.47"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.0.0-beta.47.tgz#b9c164fb9a1e1083f067c236a9da1d7a7d759271"
dependencies:
"@babel/code-frame" "7.0.0-beta.47"
...
It's actually the 47, but when I do yarn upgrade-interactive --latest I expect my package.json to be updated with the 7.0.0-beta.47 version also.
Here is the project repo
Here is the package.json with the @babel/core dep
To replicate run these commands:
git clone [email protected]:accurat/accurapp.git
cd accurapp
git checkout big-updates
yarn
yarn upgrade-interactive --latest
@babel/core isn't in the list:

Ah, yes, you've stumbled upon the edge case. I discussed this in a couple other issue threads, but I know the GitHub search leaves a lot to be desired...
The way the code works is that it first gets a list of outdated items (same as running yarn outdated. In your case it finds nothing outdated because latest is beta.47 and you have beta.47 installed.
Then, since there is nothing to update, the code returns.
If @babel/core had been outdated, then your package.json would have been updated. It's a bit of a weird case. I suppose it's a bug, but it never felt really critical since you'll still have the correct version actually installed.
Weird, I don't know how it happened, I usually update the deps just with the upgrade-interactive command.
Anyway, I want a way to write the latest and installed version in the package.json, even when the semantic versioning is correct.
Oh, I figured out how this happened, I removed the yarn.lock, the node_modules and run yarn again. So yarn installed the latest semantically correct version.
Most helpful comment
Weird, I don't know how it happened, I usually update the deps just with the upgrade-interactive command.
Anyway, I want a way to write the latest and installed version in the package.json, even when the semantic versioning is correct.