DEV Community

Clarice Bouwer
Clarice Bouwer

Posted on

1

How to update outdated npm packages

Keeping your npm packages up-to-date is crucial for maintaining the security and performance of your projects. In this guide, I'll walk you through the steps to identify and update outdated npm packages.

The npm outdated command checks the registry for outdated installed packages. It shows direct dependencies by default, but with the --all flag, it includes all outdated meta-dependencies. Key output fields include wanted (maximum version satisfying semver in package.json), latest (latest version in the registry), location, and depended by. Red indicates a newer version matches semver requirements, and yellow indicates a newer version above semver requirements. Various flags like --json, --long, and --global modify the output format and scope.

For more details, visit npm outdated documentation.

Note that by default npm update will not update the semver values of direct dependencies in your project package.json. If you want to also update values in package.json you can run: npm update --save (or add the save=true option to a configuration file to make that the default behavior).

For more details, visit npm update documentation

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay