HiveBrain v1.2.0
Get Started
← Back to all entries
snippetreactCritical

How do I update each dependency in package.json to the latest version?

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
updatepackagethelatestjsonversiondependencyhoweach

Problem

I have a React app with deprecated dependencies. To make it work, I have to update the dependencies to their newer (but stable) versions.

Per How can I update each dependency in package.json to the latest version?, to update dependencies in package.json to latest versions, npm-check-updates is the best option for npm. However, I'm using Yarn for package management. Is there an equivalent of npm-check-updates in Yarn, so that I use a single package manager to manage my dependencies?

Solution

yarn upgrade-interactive --latest

But you must have a valid yarn.lock file before doing it. If you are using npm, you must delete package-lock.json at first. Then run yarn (or yarn --ignore-engines when there are version dependencies) to create structure. After that, you can do upgrade-interactive. Without that, yarn shows an upgrade, but no changes and effects in package.json.

Context

Stack Overflow Q#62650640, score: 341

Revisions (0)

No revisions yet.