Skip to content
drugoi.dev
TwitterTelegramLinkedIn1on1

Updating Project Dependencies: npm, Yarn, and pnpm

Code, npm, yarn, pnpm, package-management

The post was originally written for the Telegram channel.

Yarn has a very handy yarn upgrade-interactive command (and a --latest flag if you want to upgrade to the latest versions).

Npm does not have such a convenient feature out of the box, but it does have an excellent package npm-check that will show which packages can be updated and to which versions.

Result of npm-check

Update your packages on time, but don't forget to read the changelogs so you don't accidentally break your project 👌🏻

Alternatives

npm-check-updates

Ruslan @iamroose suggested that there is an even more convenient alternative - npm-check-updates

Result of npm-check-updates

Visually it looks fresh and it is possible to update specific packages via regex or flags:

# upgrade everything except nodemon
ncu \!nodemon
ncu -x nodemon
ncu --reject nodemon

pnpm

Kamil Emeleev shared in the comments how to update packages using pnpm:

# Update packages in pnpm
pnpm update --interactive --latest -r
💚 Nikita Bayev Paper Company
Theme by LekoArts