Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add flag to force `update` to install latest version #4357

wants to merge 1 commit into


None yet
6 participants

refack commented Dec 20, 2013

But only in "our" package's modules (not recursively, cause that's just crazy ;-p )

refack commented Dec 20, 2013

If there's a positive reaction to this PR I'll add tests and documentation.


rlidwka commented Dec 21, 2013

why not just change your package.json instead or explicitly run npm install something@latest?

refack commented Dec 21, 2013

Obviously both are valid, but the use case is when I start preparing a new release, first I start by updating all my deps (so multiple npm install is tedious), and changing package.json is both error prone (`cause it's manual), and also explicitly declares a new state that I'm unsure whether is safe or not (and might get persisted inadvertently).
Semantically what I need is a command that will allow me to peek into the future to assess it's safeness without changing any code declarations.


domenic commented Dec 29, 2013

This seems reasonable to me, but I would like some other maintainers thoughts. I know @isaacs was concerned about configuration flag explosion.

refack commented Dec 29, 2013

I just found out that bower has such a flag.


timoxley commented Jan 12, 2014

Related: #4357


smikes commented Feb 22, 2015

How about this:

npm --depth 0 outdated
npm --depth 0 update --save

The first command will list what's about to happen; the second command will try to update all the direct dependencies to @latest, honoring semver.


othiym23 commented Feb 22, 2015

Why is --depth 0 necessary in either case? Is this presuming a pre-npm@2.6.1 world?


smikes commented Feb 22, 2015

Yes, at present I am assuming that at best people are running npm@latest, not npm@next

Also even with npm@2.6.1 once when I did update --dev --save-dev the behavior looked suspiciously like an infinite loop.


othiym23 commented Feb 27, 2015

A lot has changed around npm outdated and npm update recently, and I don't think this patch makes sense. @smikes, if you (or somebody else!) want to put together a patch to make

npm outdated
npm update --save
npm update --save-dev

work the way you describe above, that would have my support / get merged quickly.

@refack, I apologize for the lengthy delay between you submitting this patch and us reviewing it, and I also apologize that all that time went by only for me to decide not to merge it. Thanks for taking the time and energy to put this together!

@othiym23 othiym23 closed this Feb 27, 2015

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