
What is the package.json and How to Update all Packages in your package.json with only 2 commands 😲
Hey everyone 👋🏻, I get this question many times that what is the use of package.json, and what to do if our versions of packages are older? So here
Draft
1 November, 2021
Contributors
Hey everyone 👋🏻, I get this question many times that what is the use of package.json, and what to do if our versions of packages are older? So here is an answer to both the questions
If you were working on an app a long time back and want to update some things, you should update the versions of the packages. Doing this manually will take a lot of time, so today I am gonna show you how to do this with only 2 short commands.
What is package.json?
Whenever you add a package with
npm install package-name
or yarn add package-name
. Then the package gets added in the package.json. So basically, it is the list of packages that are present in your app.•
There might be a new feature in some of the packages you want to use, but it wasn't there when you installed it.
•
The syntax might have changed.
•
It keeps your app stable, usable, and secure.
•
The package would have improved.
•
Bugs would be removed (if any)
Updating the packages
So today, I am just gonna clone an old project of mine and show the difference between the two package.json files.
These are the dependencies in the
package.json
file of an old react project-Running the two magical 🪄 commands
This is what the updated package.json looks like-
A new version has come for almost every package

I hope you learned from this short article. Let me know what you want to see next 😉.
Useful links -