Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 6
    There NEEDS to be some better answers here. Obviously with dependency resolution, you can't always have the latest version of everything. Maximizing the greatest number of latest versions of modules is just that, some sort of optimization problem. But NPM doesn't know which modules you want to be most recent more than others. It would be cool if there was something like this: npm update --latest x y z, where x y z are the modules you want to be as recent as possible and all other modules will follow with their most recent compatible version. Commented Oct 26, 2016 at 17:18
  • 4
    npm will correctly handle version conflicts between shared dependencies by downloading the correct one for each. So, if Dep A depends on Dep C v1.0.0 and Dep B depends on Dep C v2.0.0, they will each be installed and used appropriately. Therefore, you are free to install the latest of any packages you would like. Commented Oct 26, 2016 at 20:59
  • 1
    Try this to force upgrade: npm outdated | sed '1d; s/ .*/@latest/' | xargs npm i --save Commented Aug 23, 2019 at 14:53
  • I'm always checking this answer. But I see that it has slipped in the Google results. Hopefully this comment will help push it's relevance back up!! Commented Sep 9, 2019 at 5:42
  • @RaineRevere Seems something has happened about this during 2017 (npm 5.0). Would you be so kind and check stackoverflow.com/questions/16525430/… and maybe add a reference to it? Some answers below mention 'npm outdated' and 'nom update' but they are lost in the dust. I found your question by search but the other one seems more up-to-date. Commented Nov 23, 2019 at 17:54