- [Instructor] Sometimes, you will get warnings about
the versions of your packages being out of date.
And also, I'll show you in a second how to do
a simple command to understand which packages
are outdated.
At the same time, I'll show you how to install
a specific version of a package
so I simulate having an outdated one.
So, let's go back to our terminal
and the first thing we'll do,
we'll install globally ESLint.
But what I wanna do is actually install a previous version.
And the syntax to install a specific version
is to use the @ sign like so
and then the version you want.
And then, -g for globally.
So, the actual commands to actually check
if our dependencies needs to be updated or not
is npm outdated.
So, if we just do npm outdated
it's going to check our dependencies locally
and we just installed them.
So, most likely, nothing's gonna happen.
So, let's check our dependencies globally,
So, npm outdated -g.
Now we get a completely different message.
We have two packages that needs to be updated,
ESLint and npm.
And if you look at the current versions,
these are the versions that we have installed
in the system.
The wanted versions are
the preferred versions that we should be on.
And these are the latest versions.
So, as you can see, 5.6, 5.10 and 6.4,
5.2, 5.5 and 5.5.
Alright, so let's update our ESLint package.
So, there's two ways to do this.
The first way is npm update and the name of the package.
Now, this command works on and off.
I've had minor successes and I've actually researched
in the forums to see if I was alone.
So that's the case, for some people it works,
for some it doesn't.
Sometimes it's a question of package.
So I always use the install for updating a package.
So, I will literally do something like this,
as if I was installing that package again.
And it will update it to the latest version.
You can also specify the version.
So if you wanna have 5.10 as opposed to 6.4,
you can do that as well.
So, let's do ESLint and we need to do sudo
because this is global,
- g.
And then we're not specifying the version
'cause I wanna be at the latest version
which is the same version that we want.
And then install like this.
Then if we do an outdated globally,
we'll see a report that only mentions npm.
So, this is how you update and check
if your packages are updated or not.
And you can do this on your local projects as well.