autoupdate or check if outdated automatically #5495

Closed
jonathanong opened this Issue Jun 16, 2014 · 16 comments

Comments

Projects
None yet
8 participants
@jonathanong

so many issues can be resolved just by updating

@dstroot

This comment has been minimized.

Show comment Hide comment
@dstroot

dstroot Jul 10, 2014

Amen!

dstroot commented Jul 10, 2014

Amen!

@skube

This comment has been minimized.

Show comment Hide comment
@skube

skube Jul 10, 2014

As a noob, I love how, for example, Yeoman not only tells me it's out of date, but also shows me the command to update. IMHO, it would be great if more CLI tools did this.

skube commented Jul 10, 2014

As a noob, I love how, for example, Yeoman not only tells me it's out of date, but also shows me the command to update. IMHO, it would be great if more CLI tools did this.

@sindresorhus

This comment has been minimized.

Show comment Hide comment
@sindresorhus

sindresorhus Jul 20, 2014

👍 From experience most users either don't update or have no idea how or even that they should.

Autoupdate is most likely out of the question as it can cause issues, like the problem with npm corrupting itself when trying to update itself and leaving the system with no npm. For the user npm would suddenly not exist in that cause. Users also don't like tools mocking with their system automagically.

I think it would be useful however with a slight nudge to the user about updating.

As @jonathanong mention so many npm issues* are caused by an outdated npm version.
__Not only on this issue tracker. I'm forced to handle a gadzillion of them on various projects I'm involved in...*

Yeoman and Bower uses update-notifier.

👍 From experience most users either don't update or have no idea how or even that they should.

Autoupdate is most likely out of the question as it can cause issues, like the problem with npm corrupting itself when trying to update itself and leaving the system with no npm. For the user npm would suddenly not exist in that cause. Users also don't like tools mocking with their system automagically.

I think it would be useful however with a slight nudge to the user about updating.

As @jonathanong mention so many npm issues* are caused by an outdated npm version.
__Not only on this issue tracker. I'm forced to handle a gadzillion of them on various projects I'm involved in...*

Yeoman and Bower uses update-notifier.

@othiym23

This comment has been minimized.

Show comment Hide comment
@othiym23

othiym23 Jul 21, 2014

Contributor

The time has come for npm to start letting users know when they're running an old version. There are two pieces to this:

  1. The registry will need to check whether it's getting requests from an old version, and return a warning when it gets requests from same, and
  2. The npm CLI should check to see if it's still the latest version, and if not, let the user know.

The second part will be easy enough to add (and should be implemented in such a way that it doesn't try to do the check when it knows it's running offline), but the first will require changes to npm-registry-couchapp and probably requires a little bikeshedding to deal with the large edge cases, like the fact that only relatively recent versions of npm include their version in their User-Agent header. Either way, this would be a major usability improvement for a relatively small amount of work.

Contributor

othiym23 commented Jul 21, 2014

The time has come for npm to start letting users know when they're running an old version. There are two pieces to this:

  1. The registry will need to check whether it's getting requests from an old version, and return a warning when it gets requests from same, and
  2. The npm CLI should check to see if it's still the latest version, and if not, let the user know.

The second part will be easy enough to add (and should be implemented in such a way that it doesn't try to do the check when it knows it's running offline), but the first will require changes to npm-registry-couchapp and probably requires a little bikeshedding to deal with the large edge cases, like the fact that only relatively recent versions of npm include their version in their User-Agent header. Either way, this would be a major usability improvement for a relatively small amount of work.

@dstroot

This comment has been minimized.

Show comment Hide comment
@dstroot

dstroot Jul 21, 2014

Isn't #2 sufficient? (it's late and caffeine is running low - I must be missing something)

dstroot commented Jul 21, 2014

Isn't #2 sufficient? (it's late and caffeine is running low - I must be missing something)

@othiym23

This comment has been minimized.

Show comment Hide comment
@othiym23

othiym23 Jul 21, 2014

Contributor

@dstroot not if we want to prod users of versions of npm older than whatever version #2 lands in to update!

Contributor

othiym23 commented Jul 21, 2014

@dstroot not if we want to prod users of versions of npm older than whatever version #2 lands in to update!

@dstroot

This comment has been minimized.

Show comment Hide comment
@dstroot

dstroot Jul 21, 2014

Ah! I'm a little slow! ;)

dstroot commented Jul 21, 2014

Ah! I'm a little slow! ;)

@thomblake

This comment has been minimized.

Show comment Hide comment
@thomblake

thomblake Jul 24, 2014

Contributor

only relatively recent versions of npm include their version in their User-Agent header

Well that at least tells you right away that the version is outdated.

Contributor

thomblake commented Jul 24, 2014

only relatively recent versions of npm include their version in their User-Agent header

Well that at least tells you right away that the version is outdated.

@domenic

This comment has been minimized.

Show comment Hide comment
@domenic

domenic Aug 7, 2014

Member

If someone, say @sindresorhus, put together a pull request to use update-notifier (i.e. part 2 of your plan), would that be accepted?

Member

domenic commented Aug 7, 2014

If someone, say @sindresorhus, put together a pull request to use update-notifier (i.e. part 2 of your plan), would that be accepted?

@othiym23

This comment has been minimized.

Show comment Hide comment
@othiym23

othiym23 Aug 7, 2014

Contributor

The biggest blocker at this point is I really don't want to let a feature like this loose until we are sure npm is no longer going to periodically and arbitrarily auto-baleet itself on upgrade. I don't even want to think about the support nightmare that would cause. So realistically, this is post-"multi-stage install".

Contributor

othiym23 commented Aug 7, 2014

The biggest blocker at this point is I really don't want to let a feature like this loose until we are sure npm is no longer going to periodically and arbitrarily auto-baleet itself on upgrade. I don't even want to think about the support nightmare that would cause. So realistically, this is post-"multi-stage install".

@domenic

This comment has been minimized.

Show comment Hide comment
@domenic

domenic Aug 7, 2014

Member

OK. And that opinion holds even for an update-notifier, without the auto-update part?

Member

domenic commented Aug 7, 2014

OK. And that opinion holds even for an update-notifier, without the auto-update part?

@othiym23

This comment has been minimized.

Show comment Hide comment
@othiym23

othiym23 Aug 7, 2014

Contributor

Sorry! I misread your question / didn't read it completely! Hmmm…

If there were an update notifier that integrated with npm's existing configuration infrastructure, that didn't add a dependency on YAML(?), and printed out its results in a npm-consistent fashion, that would be integrated immediately. update-notifier is kind of a tight squeeze into npm, though. If somebody wanted to take a stab at it, I'd work with them, but it might be a fair amount of work to get it in in a way that doesn't damage the code base.

Contributor

othiym23 commented Aug 7, 2014

Sorry! I misread your question / didn't read it completely! Hmmm…

If there were an update notifier that integrated with npm's existing configuration infrastructure, that didn't add a dependency on YAML(?), and printed out its results in a npm-consistent fashion, that would be integrated immediately. update-notifier is kind of a tight squeeze into npm, though. If somebody wanted to take a stab at it, I'd work with them, but it might be a fair amount of work to get it in in a way that doesn't damage the code base.

@rlidwka

This comment has been minimized.

Show comment Hide comment
@rlidwka

rlidwka Aug 8, 2014

Contributor

How about handling it on server-side and making use of Warning HTTP headers?

Contributor

rlidwka commented Aug 8, 2014

How about handling it on server-side and making use of Warning HTTP headers?

@othiym23

This comment has been minimized.

Show comment Hide comment
@othiym23

othiym23 Aug 8, 2014

Contributor

@rlidwka Eventually we'll want both approaches, but either way, the client will need support for displaying messages sent back by the registry.

Contributor

othiym23 commented Aug 8, 2014

@rlidwka Eventually we'll want both approaches, but either way, the client will need support for displaying messages sent back by the registry.

@othiym23

This comment has been minimized.

Show comment Hide comment
@othiym23

othiym23 Aug 22, 2014

Contributor

A piece of this is in 1.4.25 / 2.0.0-beta.0, which is the piece that will display a banner from the registry, if one is available. The missing piece is the piece that checks from the CLI and tells people to update / offers to update it for them. I'm not going to have time to work on that anytime soon, but if somebody wants to take a stab at it, PATCHES WELCOME! \o/

Contributor

othiym23 commented Aug 22, 2014

A piece of this is in 1.4.25 / 2.0.0-beta.0, which is the piece that will display a banner from the registry, if one is available. The missing piece is the piece that checks from the CLI and tells people to update / offers to update it for them. I'm not going to have time to work on that anytime soon, but if somebody wants to take a stab at it, PATCHES WELCOME! \o/

@othiym23

This comment has been minimized.

Show comment Hide comment
@othiym23

othiym23 Jul 20, 2016

Contributor

I'm going to close this issue in favor of #11473, which includes notifying users that their CLI version is out of date, without adding auto-updating the CLI, which is fraught with danger. Thanks to all for their time and discussion!

Contributor

othiym23 commented Jul 20, 2016

I'm going to close this issue in favor of #11473, which includes notifying users that their CLI version is out of date, without adding auto-updating the CLI, which is fraught with danger. Thanks to all for their time and discussion!

@othiym23 othiym23 closed this Jul 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment