This course has been updated! We now recommend you take the Introduction to Node.js, v2 course.

Check out a free preview of the full Introduction to Node.js course:
The "Installing Node.js" Lesson is part of the full, Introduction to Node.js course featured in this preview video. Here's what you'd learn in this lesson:

Scott describes installing node using both from Nodejs source, and using NVM. Scott explains several costs and benefits of each, and why NVM is the preferred method.

Get Unlimited Access Now

Transcript from the "Installing Node.js" Lesson

>> Speaker 1: So what we're gonna do now is we're gonna install Node. So if you already have Node, then congratulations you already installed Node. Yes.
>> Speaker 2: Is there a version you want us to be on?
>> Speaker 1: Yep, we're gonna get into that. It's gonna be the latest, which is like ten something, anything ten.

[00:00:16] But so there's two ways, okay, there might be a lot of ways to install Node. But there's really only two ways to install Node and there actually is only one way to install Node and that is to use NVM, node version manager. That is my recommended way to install Node.

[00:00:31] If you were to Google how to install Node. That might not be the first thing to come up, because obviously, what would probably come up is installing it from the Node source, from the Node website, and they have an installer, they have all this amazing stuff. You could totally do that, and actually that's fine for this course, cuz we're only gonna stick to one version.

[00:00:48] But going forward, as someone who's developing for Node, and has seen a lot of different things, you will avoid tons of issues if you just install what node version manager. So we re going to go over the differences. So if you installed from the node source, like I said, it's the easiest way to install.

[00:01:02] They have an installer for your computer, like a gooey, install everything for you, it's super legit. You can't mess it up. It works on pretty much any operating system. But it kind of limits your options for having many versions of Node, because it installs in one root place on your computer.

[00:01:19] And that's it. You can't put another version there without having to manually do things, so that kind of sucks and it could cause permission errors. There's some things that you have to do with Node when it comes to installing modules. Globally, and sometimes it needs higher level permissions for that,and then you have to start doing all this sudo stuff.

[00:01:37] And it just messes everything up, so I highly recommend not doing it from the node source, although it works. For this course you just won't have any of those problems most likely. But what I do recommend is using node version manager and that's because it allows you to run mini versions of node whenever.

[00:01:52] So because the thing about Node is that some modules might only work for some version, or you might be deploying to this cloud provider and it only has this version. You need to be able to switch versions sometimes. And being able to do that, which is one command from your terminal, is super awesome.

[00:02:11] NVM allows you to do that, so you can just download as many versions as you want. And it's like, all right, use this one now or use this one. And it doesn't mess up permissions and it kinda encapsulates everything. And it's super useful, especially for testing. I use this for testing all the time.

[00:02:23] I'm like, I've gotta test it against this version, test it against this version, test it against this version, test against this version, and that's it. I'm not gonna go below this version. So I highly recommend doing that. So you don't have to do it right now, but we're gonna get to the exercise part and we're gonna break.

[00:02:36] And everybody can start installing it. But if you want to get a head start, like go ahead. Maybe, you know, it might take a while, probably not. But yeah, we're gonna keep going for a little bit. Any questions on installing node? There's more, the links to these are gonna be in the readme for the source and the NVM.

[00:02:54] And I'm gonna walk through both of them after we, when we get to the exercise. How to do them a little bit. The installer one is super easy, literally watch me through it. NVM 1 might take some commands, but we're gonna walk through it. Any other questions on installation?

[00:03:10] You can also use docker, if you want to. I mean, if you really want docker. If you use docker and you want to just not have a node on your computer for whatever reason, then you just want to virtualize it, you can put it into docker and download the docker temp.

[00:03:21] We are not gonna go over that on this course, cuz that's a whole other thing, but that is another way to install it. That's literally another way to install everything, but we're not gonna do that.