[x] I have searched for similiar issues before filing this issue.
node version: 10
I have "vue-jest": "^3.0.4" in my project. I'm running ncu -nu and expect it to be updated to newest/latest version, including any beta/etc versions.
The latest vue-jest version as I can see is v4.0.0-beta.2.
But running ncu -nu doesn't seem to update it to that version.
You need to run with --pre 1 or --newest, since ncu ignores prereleases by default.
@stoically I did. I've tried all of these: -n, --newest, and --pre 1
PS: The issue is only with vue-jest, rest of the dependencies are updating to their alpha/beta/latest versions just fine by the way.
Oh I see, so vue-jest tagged 3.0.4 as latest and 4.0.0-beta.2 as beta - ncu looks by default at the latest tag, that's why just --pre 1 doesn't work.
--newest doesnt work because 3.0.4 got published after 4.0.0-beta.2
4.0.0-beta.2 | "2019-02-16T16:53:50.900Z"
3.0.4 | "2019-03-04T20:16:30.979Z"
That would leave us with --greatest, but that doesn't work either because it just uses lodash's last on the versions array, which again gives us 3.0.4. That is arguably unexpected behavior, because 4.0.0-beta.2 is greater than 3.0.4.
That is arguably unexpected behavior, because 4.0.0-beta.2 is greater than 3.0.4.
Agreed!
I have a similar issue where it doesn’t seem to pick up axios in -n but without it does.

I frequently run into this issue with @material-ui/lab. Here, the @latest version is 4.0.0-alpha.28 and the @next version is 4.0.0-alpha.12 - quite a bit older.
Is there a command I can use that will capture the latest version?
@alexplumb can you compare with and without -n (n for newest)
@Primajin That picks up @material-ui/[email protected] but it also picks up beta/alpha versions of many other packages. alpha.28 is the "stable" version of this particular package.
@alexplumb --pre 1 works in that case
@Primajin that looks like it might be related to the caching problem which was fixed in the latest ncu version. If you encounter it again it'd be helpful if you post as new issue since that's different from OPs issue
Thanks @stoically that did it
Is 0e368ba released yet through npm?
No. If you open commits you can see which tags belong to it, 0e368ba has none.
Published in v4.0.0
Hmm still experiencing issues with this (v4.0.1) - shall I continue in here or do you prefer a fresh Issue?

I would have expected the ones with the red underlines to also be included in -n
@Primajin
In your initial execution of ncu -n -i -u, I can't explain why terser-webpack-plugin does not appear at all. It appears fine for me:
raine[535]$ cat package.json
{
"dependencies": {
"terser-webpack-plugin": "^2.2.2"
}
}
raine[535]$ ncu -n -i -u
Upgrading /Users/raine/projects/ncu-troubleshooting/535/package.json
[====================] 3/3 100%
? Do you want to upgrade: terser-webpack-plugin ^2.2.2 → ^2.3.0? › (Y/n)
terser-webpack-plugin ^2.2.2 → ^2.3.0
Run npm install to install new versions.
0.18.1 was published after 0.19.0, thus ncu correctly returns 0.18.1 as the newest possible version:
raine[535]$ npm view axios time
{
...
'0.18.0': '2018-02-19T23:28:54.151Z',
'0.19.0-beta.1': '2018-08-09T18:44:25.247Z',
'0.19.0': '2019-05-30T16:13:16.930Z',
'0.18.1': '2019-06-01T00:46:36.277Z'
}
10.17.9 was published after 12.12.17, thus ncu correctly returns 10.17.9 as the newest possible version:
raine[535]$ npm view @types/node time
{
...
'12.12.16': '2019-12-09T20:46:09.689Z',
'10.17.8': '2019-12-09T20:46:55.283Z',
'12.12.17': '2019-12-10T19:21:19.425Z',
'10.17.9': '2019-12-10T19:22:05.828Z'
}
You can use --greatest or -t to get the highest version, regardless of publish time.
@Primajin If you could share the package.json being used, it might be possible to reproduce the terser-webpack-plugin problem, maybe its because of a combination of packages or something.
Thank you very much for all the effort! I'll see if I go with greatest then instead of newest.

-t (greatest) solves it for me - thanks a lot everyone!
Most helpful comment
Published in
v4.0.0