Installing Node.js & Yarn

Lecture description
The last thing you need to install is Node.js. You'll be using Node.js to create web servers, compile files, and much more!
Learn more from the full course
The Complete React Developer Course (w/ Hooks and Redux)
Learn how to build and launch React web applications using React, Redux, Webpack, React-Router, and more!
39:11:55 of on-demand video • Updated October 2020
Build, test, and launch React apps
Use cutting-edge ES6/ES7 JavaScript
Setup authentication and user accounts
Deploy your React apps live to the web
Learn the latest React libraries and tools
Master React, Redux, React-Router, and more
English [Auto]
Now that you have your text editor all set up in this one, we have one more thing to do. We have to install two tools Node.js and yarn, two tools that we're going to be using extensively throughout the course. The first one node we can find at Nodejs.org and the second one yarn we can find at Yarn PCMag.com. Now, as always, when I introduce a new tool or library, I'm going to show you where it lives on the web. So if you forget how something works or you want to learn more, you know where you can get that done. First up is Node. Node is JavaScript on the server. We're going to be using Node just a little bit throughout the course. We're going to be creating a production web server with Node a little bit later and we're also going to be using tools that use Node. So later on in the course you're going to learn how to use Webpack. It's a fantastic tool, but it requires Node to be installed. So we're just going to get this installation out of the way up front, down below. You can go ahead and grab the latest version currently available right now. It happens to be V 8.1. Point two if it's another version of V8 or if it's another version completely like V nine, that is perfectly fine. We're only going to be using a few features from Node and those features are very fundamental and aren't going to change. So as long as you are on V eight or up, you're good to go. Now you can go ahead and install it. It's one of those click next installers. There's nothing crazy you need to do. You just need to jam that next button a ton of times until it says that you're done. I already have it installed, so I'm not going to click through. But do go ahead and take a quick moment to pause the video and click through when you get to the final screen and it says Nodes installed, go ahead and click play. All right. Hopefully you were able to get through the installer without too much trouble. And at the end you saw that Node was installed successfully. If you got an error anywhere along the way, that is okay. Just open up a question in the Q&A and I'll work with you to get Node installed successfully. Once you do have Node installed, we're going to head over into the terminal or the command prompt on Windows. From here, we're going to access a new command, a command that we have available because we just installed Node. This is the Node command and for the moment we're going to run it with the V flag that's going to allow us to double check that node was installed. Make sure you do see a valid version here. It's okay if the version is different as long as it's greater than v 8.0.0. Now, along with Node, which we'll talk about later, we also got NPM, which stands for Node Package Manager and this allows us to install various dependencies, things like yarn and things like React and the other libraries in the React ecosystem that we'll be using now, NPM and Yarn, they both aim to get the same job done. So if you've used NPM before, yarn is going to look very similar. If you haven't used NPM before, that's okay. We're going to be running a single command with NPM, then we'll forget it ever exists. So we're going to run NPM with the V flag first. Here we can see we do have NPM installed. Make sure you do have a valid version showing up. Then we're going to run a single NPM command and that's the last time we'll be using this tool NPM. Install with the g flag. Yarn. So this is going to install yarn on your machine and it's going to install it globally. So it's going to give us access to a new tool from the command line. It's important to type this out exactly as I have here. We can then go ahead and run it. That is going to go through the process of installing yarn on your machine. And once it's done, we're just going to confirm that yarn was successfully installed. We can do that using yarn with the hyphen hyphen version argument. I'm going to run yarn with version right here. I do get a valid version 0.20 4.5. If you're running on a Windows machine, you do also need to restart your machine for yarn to completely configure itself. If you don't restart your Windows machine, you are going to run into errors in the next several videos when we install other tools using yarn. If you are seeing the version and you have restarted, if you're on Windows, then you are all done with this video and we can continue on to the next section where we're going to start diving in to react.