npm outdated --parseable --depth=0 | cut -d: -f4 | xargs npm installPer the official documentation, here's what yarn upgrade --latest does:
The
upgrade --latestcommand upgrades packages the same as theupgradecommand, but ignores the version range specified inpackage.json. Instead, the version specified by thelatesttag will be used (potentially upgrading the packages across major versions).
As best I can tell, there is no equivalent command for npm, though people have asked for it and have even created npm packages that do this.
Based on another gist, this is a one-liner that achieves similar behavior.
Warning: this will overwrite your currently installed packages, and — as always when chaining multiple commands — things can go wrong. Please understand what you're doing, and don't run this command if you're worried about your environment or package.json getting messed up.