Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
277 views
in Technique[技术] by (71.8m points)

node.js - Yarn - How do I update each dependency in package.json to the latest version?

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

As per this stakoverflow thread, 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.

question from:https://stackoverflow.com/questions/62650640/yarn-how-do-i-update-each-dependency-in-package-json-to-the-latest-version

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

yarn upgrade-interactive --latest

But you have to have a yarn.lock file before do it. If you are using npm, you must delete package-lock.json first. Then run yarn to create structure. After that you can do upgrade-interactive. Without that, yarn shows upgrade, but no changes and effects in package.json.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...