In a previous lecture in this course, you learned how to upgrade your node raid server version to the
latest available version.
In this lecture, I'll show you how to do the same for the underlying Node.js server on which no threat
is based.
You can see here that I've looked into my note read save on my Raspberry Pi inside the node red directory
where node radius installed and have used the command node minus V to get the current version of Node.js
on which my node installation is running.
And as you can see, it's version 16.1 5.0.
If I go on to the Node.js website and have a look at the latest available version, I can see that the
stable version or the long time service revision is 16.15 point one.
So there is a minor update to the package.
There's also the the current latest version, which is at 18 .3.0.
I tend to prefer to go with the ltz versions rather than the latest available version for stability
reasons.
And typically I don't need to have access to the bleeding edge features of Node s.
Another thing that I want to mention here in relation to the relation between the versions of note rate
and note, J.S. is here in the release plan on the note rate website.
All right.
Just go to the great dot org about releases this link right here and you can see what the plan is going
ahead and recording this around here in June 2022.
And you can see that the current version of note rate, the latest version is 3.0, even though I'm
running 2.2 in this example.
But you can see that the supported versions of note on note 12 in maintenance mode, note 14 also in
maintenance mode and to note 16 which is in active mode and note 16 will be in active mode up to later
this year.
Having a look at my running version of note read, just go in here.
You can see did version 2.2.
So I should probably upgrade to version three at some point soon.
All right.
So there's a few different ways by which I can go ahead and do the upgrade of the Note J.S. installation
on my Raspberry Pi.
But the method that I prefer is via is by using the NPM package manager, and there's a particular package
in here called in which allows me to interactively manage my Node.js version, try out a few other methods
as well.
But I find that the NPN and version, the interactive manager for Node.js, is the easiest and most
reliable method.
So that's what I'm going to use in this example, in this lecture.
So I've already ran the node of the command to get the current version of Node J.S. and it's 16.1 5.0.
The next thing that I'll do is I'll clear the NPM cache and do that using NPM cache clean and F is for
force.
That's going to clear the cache.
And just note that I'm doing all this work inside the don't know to read directory.
All right.
And that's done.
Now, I've already done this earlier, but in case you haven't done it, you need to go ahead and install
the end package or the the note version manager, then do that using NPM install.
G and you find a command for that and.
They're right here.
And that's going to instill in.
Okay.
And the reason that I got the error messages is that I actually need to use pseudo in order to run this
command as a super user.
So I'm going to clear this and try again with pseudo.
And p m.
Install.
G and.
Okay.
Well done.
And you can see I already had version 8.25.5 installed and what I've just done upgraded my end package
to eight point 12.1.
Now that I've got an installed, I can go ahead and upgrade.
Note to the latest version.
So I said I'm going to go for the latest stable version, which this version right here.
So the command for that is sudo and use the end package manager to install the stable version of new
to chase.
And run his command.
You can see that he picked Vision 16.2, 15.1.
The latest available LTE version and it's continuing with the installation.
Okay.
So it's completed with the installation notes.
Have a look at the current version.
Again, I'm going to use the command node V just like before.
And you can see they're just showing me 16.15 point one.
If in your case is showing the old version of a node J.S., then use the hash command goes like this
hash to basically rehash Node.js.
J.S. And then run note the again and it will show you the correct current version of note.
Now, another thing that I should show you before we go on and restart Node, read this in case you
want to go for a newer version of for the latest version of Node.js.
What you can do is to use the end command again and install the latest version of Node.js.
In this case, it would go for version 18 .3.0.
Not going to do that, of course, now, or if you want to be specific about which version of Node she'd
like to install, then instead of stable or latest, you can just be specific and say I'd like to install
version say 18 .3.3 and then the end vision manager will install the specific version of note that you
have requested.
All right.
So the upgrade of Node.js is now finished.
For this change to take effect in node red, you need to restart it.
So the way you do this is first I stop node red to say Node stop and then start it.
Know, Rich start.
Give it a moment to spin up.
And you see here that the note James version, that note read is using is six point 15.1, which I just
installed.
And just kind of refresh.
Okay.
It's not ready yet.
I'm waiting for the dashboard to start as well.
After the polite notes.
All right.
Here you go.
And that should work now.
And don't release back up.
And that's how you can upgrade the version of Node.js used by trade.