05 - How to install node.js (for absolute beginners)

The important bits

Transcript

00:00 In this episode, we'll demonstrate how to install node. We will cover what version you should install and what methods you can use and which method you should use. The first thing you'll probably notice is that it jumps from version 12 here on the left to version 14 on the right. So what happened to version 13? Let's take a look at this diagram to help explain that let's start with the even numbers first. So among the even options, there is an LTS release, which stands for "long term support". And there's a latest release. Sometimes they're one of the same. So currently version 12 is the long term support release and version 14 is the latest release. Let's look here at the long term support schedule. So version 14 is currently active and will go into maintenance in October 2021. 15 is currently being worked on and then version 16 will become the current version sometime in 2021.

00:58 So version 12 is now in maintenance mode, which means there are no longer any new changes going in there. It's just gonna be bug fixes and security fixes, which means it's gonna be stable and supported until April 2022. It's about two years out, roughly there's a lot going on here. But the important part to remember is this, if it's blue, it means it's active, which means any major fixes any major security bugs will be added to that version, so it's safe to use. If it's gray and it's under maintenance, it is definitely safe to use until the maintenance period ends. And if it's under maintenance, it means no new features will be added. If it's in blue, under active, minor, non breaking features may be added. And if it's green, it means new development. Anything could happen just to illustrate that here LTS means long term support, which is great for your work and for your job.

01:54 It means it's stable. It's the most stable version and it'll be supported for a while. The latest even means it's also stable is great for your personal work. If there are features in there that you care about, it could even be safer work. I would stick with the LTS version because it's the most stable version at the moment. Let's talk about odd versions for a moment. Odd is where anything experimental or brand new features go in. It is considered the unstable branch. So it's gonna be new features. It's great. If you wanna test out brand new features, if you use it for your personal development, expect that some of the node modules won't work. So you'll definitely have a rockier time. I would stay away from odd versions unless you know what you're doing with node. Alright, let's get back to the node website. Now that we know what version we want. Let's talk about the different methods to install node with. And generally I recommend one of three methods. If you're totally new to node, if you don't use home brew, or if you're on windows, I'd recommend just pressing the big green button here. It'll use the installer, which is the easiest way to go.

02:58 Let's take a look at this here. So I would use the installer if you're brand new to node, or if you don't use homebrew, or if you're on windows. I would use homebrew. If you don't have much node experience, but you already use homebrew. And if you're on a Mac and if you wanna use homebrew, you can click here on other downloads. And then down here, installing node via package manager, click on Mac brew. Brew install node. Uh, this is assuming that you already have brew installed. I'll talk about installing home brew. In another episode now I recommend using NVM, which is the node version manager. If you use node often, or have lots of experience with node, if you have a periodic need to switch versions, so say you have version 12 installed, but you wanna try out some of the modern features in 14 or 15.

03:46 And if you wanna see if some of your modules or your app will work in one of those new versions, I recommend using node version manager, it's much easier than having to reinstall or uninstall and then reinstall a new version. And the nice thing is there's a Mac version and there's a windows version. Now there's one final consideration. We don't know what version brew install node will install. So how do we find that out? So if I go to the terminal here again, this is assuming I have brew installed. I can do brew search node, and here's the options after installing. So I can do brew install node@10. That'll give you a version 10. Brew install node@12. So I can assume that notice 14, but let's go to the homebrew website and we can find out. So if we go to formulae.brew.sh/formula, you can search out a little bit more information for those. So I'll type in node. So "brew install node" will install version 14, [and this] tells me what the other versions are that I can install. Great. So this tells me definitively that if I type "brew install node", it'll give me node version 14. I already have it installed, so I'm not gonna do that now, but after you install it, then you verify that it works with node -v. So here I have version 10 installed. So I'm a little bit behind and that's it. There you go. Good luck.

End