- [Instructor] When you look at the packets file,
you'll see version numbers with multiple numbers
and some weird characters.
What are those and what do they mean?
So, let's first take a look at the numbers.
The first number is usually major new releases
like a full new version of a software.
The second number is minor releases
like adding new functions to this major release
or a new tool, for example.
And finally, the last number are patches and fixes,
usually for bugs and such.
Now, what is the caret,
the character that looks like a hat?
This is the default when installing new packages
and it means that when you or another developer
installs the dependencies,
and let's say the package .JSON file
says version 4.16.3 for Express,
it means that NPM will install
any recent version available such as 4.x.x.
So, if the most current version of Express
is 4.25.4, it will install that version
but never any version five.
The tilde is a more strict versioning approach
and means that we won't install any versions beyond 4.16.x.
So, in other words, it would only install
the latest version of 4.16 but never go to 4.17 or 4.25.
And if you wanna be specific, in other words,
always install 4.16.3,
simply remove the character in the version number
so the tilde or the caret.
And so this allows you to maintain self-control
over your dependencies
in case some may completely break your application.
And roll the drums.
If you've ever heard the term cement versioning,
this is exactly what I just explained.
This is something that most developers
abide by when they publish to NPM.