Whenever we install node js in our machine it comes with a version and we do not focus on them. we think that it will automatically install the latest version and we go ahead.
4.18.2 Let's understand what it is, what these dots represent and how we can update our express server according to need.
in this blog post, we will understand how versioning works.
and it is an important topic from a security perspective.
whenever we install something in our node js it comes in the dependence section for example express
in the above image, the current version of Express is ^4.18.2 which is the latest one. But what exactly it is
^4.18.2
^ - npm uses caret (^) to designate which patch and minor versions to use.
^ - Latest minor or patch version4.18.2
-> 5.0.0
install all recommended and minor fixes automatically
4 - Major release we all are currently working on the node js 4 version this first digit represents the version. If you want to move your project from one version to another there is a chance that your project code will break so it is also called a Breaking update. But if you are starting a new project in a new version then it is good to start because it is a major realize. it may contain lots of new functionalities and new syntax etc.
18 - Recommended or a bug fix(security purpose) is recommended to add or install this new in your project. It may be a feature that you should add to your project. That's why is recommended for example before 18 we had to use 17 and then new features were added and the new one that 18. if you want to know about those features go the the History.md.
2 - It is the last digit that represents the minor fixes in the package. and it is optional to add to your current project and it will not impact your project. You can check all these minor fixes on this page express npm.
You can install any version manually by using this command
npm inastll @_version_of_node_js
Thank you for reading my content. Be sure to follow and comment on what you want me to write about next
🤓