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

--newest flag doesn't update to vue-jest@4.0.0-beta.2 #535

Closed
2 tasks done
laggingreflex opened this issue Apr 22, 2019 · 20 comments
Closed
2 tasks done

--newest flag doesn't update to vue-jest@4.0.0-beta.2 #535

laggingreflex opened this issue Apr 22, 2019 · 20 comments
Labels

Comments

@laggingreflex
Copy link

  • node version: 10
  • npm version: 6
  • npm-check-updates version: 3.1.8

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.

@stoically
Copy link
Collaborator

You need to run with --pre 1 or --newest, since ncu ignores prereleases by default.

@laggingreflex
Copy link
Author

@stoically I did. I've tried all of these: -n, --newest, and --pre 1

@laggingreflex
Copy link
Author

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.

@stoically
Copy link
Collaborator

stoically commented Apr 22, 2019

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.

@raineorshine
Copy link
Owner

That is arguably unexpected behavior, because 4.0.0-beta.2 is greater than 3.0.4.

Agreed!

@Primajin
Copy link
Contributor

I have a similar issue where it doesn’t seem to pick up axios in -n but without it does.

Screenshot 2019-07-10 at 10 35 58

@alexplumb
Copy link

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?

@Primajin
Copy link
Contributor

Primajin commented Oct 3, 2019

@alexplumb can you compare with and without -n (n for newest)

@alexplumb
Copy link

alexplumb commented Oct 3, 2019

@Primajin That picks up @material-ui/lab@4.0.0-alpha.28 but it also picks up beta/alpha versions of many other packages. alpha.28 is the "stable" version of this particular package.

@stoically
Copy link
Collaborator

@alexplumb --pre 1 works in that case

@stoically
Copy link
Collaborator

@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

@alexplumb
Copy link

Thanks @stoically that did it

@Primajin
Copy link
Contributor

Primajin commented Dec 2, 2019

Is 0e368ba released yet through npm?

@stoically
Copy link
Collaborator

No. If you open commits you can see which tags belong to it, 0e368ba has none.

@raineorshine
Copy link
Owner

Published in v4.0.0

@Primajin
Copy link
Contributor

Primajin commented Dec 12, 2019

Hmm still experiencing issues with this (v4.0.1) - shall I continue in here or do you prefer a fresh Issue?

Screenshot 2019-12-12 at 10 46 41 5

I would have expected the ones with the red underlines to also be included in -n

@raineorshine
Copy link
Owner

@Primajin

terser-webpack-plugin

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.

axios

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'
}

@types/node

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.

@stoically
Copy link
Collaborator

@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.

@Primajin
Copy link
Contributor

Thank you very much for all the effort! I'll see if I go with greatest then instead of newest.

@Primajin
Copy link
Contributor

Screenshot 2019-12-13 at 11 46 47

-t (greatest) solves it for me - thanks a lot everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants