1 00:00:00,210 --> 00:00:05,430 Before we talk about what no J.S. is or explore why it's a useful tool. 2 00:00:05,430 --> 00:00:07,240 We're gonna go ahead and install it. 3 00:00:07,320 --> 00:00:11,940 And the reason we're installing it first is because we're actually going to use a little bit of node 4 00:00:11,970 --> 00:00:17,110 j s in this section to answer those two important questions in this video. 5 00:00:17,130 --> 00:00:22,680 We're gonna install no J Yes it's a super easy process and we're also going to make sure you have a 6 00:00:22,680 --> 00:00:27,960 text editor on your machine so we can use it to write our scripts throughout the class. 7 00:00:27,960 --> 00:00:33,720 Let's go ahead and get started by installing node we can find it over at the official node Web site 8 00:00:33,780 --> 00:00:36,800 node j s dot org. 9 00:00:36,840 --> 00:00:42,660 Right here on the Node J.S. home page we have the download section for our operating system. 10 00:00:42,660 --> 00:00:43,140 Right here. 11 00:00:43,140 --> 00:00:45,750 I am indeed running on a Mac and down below. 12 00:00:45,750 --> 00:00:52,110 I have two node versions I could choose to install on the left I have version eight point twelve point 13 00:00:52,110 --> 00:00:59,280 zero which is the current L2 yes version that stands for long term support and on the right I have version 14 00:00:59,340 --> 00:01:05,700 eleven point zero point zero which is the current release with the latest features and that's the version 15 00:01:05,700 --> 00:01:09,720 of node we're going to work with throughout the class. 16 00:01:09,740 --> 00:01:12,820 This is Andrew from the future with a quick update. 17 00:01:12,830 --> 00:01:19,770 You'll notice that now the LTE version is ten point fifteen point three and the current release is 12 18 00:01:19,790 --> 00:01:21,790 point one point zero. 19 00:01:21,800 --> 00:01:28,430 I've updated the class and to get the most out of the course it is now recommended that you use version 20 00:01:28,430 --> 00:01:30,770 twelve or greater. 21 00:01:30,770 --> 00:01:33,460 All right that's it for this quick interruption. 22 00:01:33,470 --> 00:01:39,460 Let's get back to the course now if you're seeing a more recent current version. 23 00:01:39,500 --> 00:01:41,680 Please go ahead and install that. 24 00:01:41,750 --> 00:01:46,700 I'm frequently updating this course to always support the latest node features. 25 00:01:46,700 --> 00:01:53,240 So as you move through the class I recommend installing the newest version of node possible once again 26 00:01:53,240 --> 00:01:53,870 for me. 27 00:01:53,930 --> 00:01:57,950 That's currently eleven point zero point zero. 28 00:01:57,950 --> 00:02:02,790 So I'm going to go ahead and click that big green button that's going to download the installer. 29 00:02:02,900 --> 00:02:05,930 And it's one of those really easy click Next installers. 30 00:02:05,990 --> 00:02:08,480 So let's go ahead and run through it right here. 31 00:02:08,480 --> 00:02:14,240 There's no need to customize anything we see we'll click continue a couple of times we'll agree to some 32 00:02:14,240 --> 00:02:18,980 stuff we're not going to read and we'll choose where we want to install node from here. 33 00:02:18,980 --> 00:02:21,350 All we have to do is authenticate. 34 00:02:21,350 --> 00:02:23,160 I'm going to provide my password. 35 00:02:23,270 --> 00:02:24,910 And after just a couple of seconds. 36 00:02:24,920 --> 00:02:29,480 No J.S. will be installed on your machine and there we go. 37 00:02:29,480 --> 00:02:31,520 The note installer is all done. 38 00:02:31,520 --> 00:02:37,850 It says that node was successfully installed and all we're going to do is test that by running a single 39 00:02:37,850 --> 00:02:40,760 command from the terminal on your machine. 40 00:02:40,760 --> 00:02:45,640 We're going to make sure that node was indeed wired up correctly to do that. 41 00:02:45,650 --> 00:02:48,440 Let's go ahead and first close down the installer. 42 00:02:48,440 --> 00:02:49,870 We're all done with this. 43 00:02:49,910 --> 00:02:52,130 I am going to go ahead and move it to the trash. 44 00:02:52,130 --> 00:02:54,340 It is no longer necessary. 45 00:02:54,440 --> 00:02:59,730 And what we're going to do now is open up the terminal on our machines on my Mac. 46 00:02:59,750 --> 00:03:04,980 I'm gonna get that done by cracking open spotlight and searching for the terminal applications. 47 00:03:05,000 --> 00:03:10,760 If you're on Windows you can use the Windows key to bring up the search bar and search for the command 48 00:03:10,820 --> 00:03:12,470 prompt application. 49 00:03:12,560 --> 00:03:17,870 If you're on Linux the exact name and location is going to depend on your distribution you're looking 50 00:03:17,870 --> 00:03:23,320 for something like the terminal the command prompt or the command line. 51 00:03:23,330 --> 00:03:29,460 Now we're going to go ahead and crack this open and what we get regardless of our OS is the same thing. 52 00:03:29,480 --> 00:03:35,090 Stylistically it's going to look a little bit different but it is a place for us to type commands. 53 00:03:35,090 --> 00:03:40,640 We can then hit enter to run those commands and we'll see the results right here in this screen. 54 00:03:40,670 --> 00:03:48,350 Now when we installed node j s we didn't get a gooey application with fields and buttons and taxed instead 55 00:03:48,650 --> 00:03:50,140 what we got as a command. 56 00:03:50,150 --> 00:03:52,810 We can now run from the command prompt. 57 00:03:52,850 --> 00:03:57,920 We're going to be using this command hundreds of times throughout the course and we'll learn a lot more 58 00:03:57,920 --> 00:04:00,560 about it and how it works throughout the class. 59 00:04:00,560 --> 00:04:06,910 For now though we're going to use it in one way to check for the node version installed. 60 00:04:06,920 --> 00:04:13,850 So right here we're gonna type out what seven characters to start we will run the node command. 61 00:04:13,850 --> 00:04:21,260 So we're gonna type out node and oh d e followed by a space and we're going to provide a argument to 62 00:04:21,260 --> 00:04:25,960 this command telling it that we just want to know the version of node that's running. 63 00:04:26,000 --> 00:04:31,430 So right here after that space it is a hyphen followed by the letter V. 64 00:04:31,430 --> 00:04:36,500 Now if we go ahead and run this we are going to get the version of node we just installed right here 65 00:04:36,560 --> 00:04:42,800 I'm seeing version eleven point zero point zero which is indeed the version I installed a few minutes 66 00:04:42,800 --> 00:04:44,240 ago right here. 67 00:04:44,240 --> 00:04:51,050 You might not see the same version I have but you should see the same version you just installed. 68 00:04:51,050 --> 00:04:52,790 Now what if you're not getting that. 69 00:04:53,030 --> 00:04:59,480 Well if you're not getting a version that likely means node wasn't installed correctly and to simulate 70 00:04:59,510 --> 00:05:05,760 what this looks like I'm just going to miss type node so I'll type node with two E's as an example. 71 00:05:05,930 --> 00:05:12,080 Then I'll try to use this the argument to ask for the version but there is no node command with two 72 00:05:12,140 --> 00:05:13,820 E's So what do I get. 73 00:05:13,820 --> 00:05:20,450 I get an error saying something like command not found if you're seeing something like this when you 74 00:05:20,450 --> 00:05:26,570 run the correctly spelled command and that means that node wasn't installed correctly and that we need 75 00:05:26,570 --> 00:05:29,880 to address that before you can continue on to do that. 76 00:05:29,900 --> 00:05:35,600 All you have to do is crack open a question in the course Q and A and I'll work with you to get node 77 00:05:35,630 --> 00:05:37,220 installed correctly. 78 00:05:37,250 --> 00:05:43,640 So at this point we've installed node j s and we've confirmed that we can actually use it on our machines 79 00:05:43,850 --> 00:05:48,350 and that's where we're going to stop with the terminal for now I'm going to leave the terminal open 80 00:05:48,350 --> 00:05:51,290 as we'll be using it in the next several videos. 81 00:05:51,290 --> 00:05:56,810 And if you don't have any previous terminal experience don't worry we'll cover all of the commands we 82 00:05:56,810 --> 00:06:00,740 end up running no terminal experience required. 83 00:06:00,740 --> 00:06:05,630 That's all we're going to do with node 4 now to wrap up the video I want to make sure we all have a 84 00:06:05,630 --> 00:06:09,970 text editor we can use to write out our node scripts. 85 00:06:10,090 --> 00:06:15,170 So to do that let's go ahead and explore a couple of different options throughout this class. 86 00:06:15,170 --> 00:06:17,750 I'll be using Visual Studio code. 87 00:06:17,750 --> 00:06:25,140 You can find and install this over at code dot Visual Studio dot com. 88 00:06:25,140 --> 00:06:28,500 Now there are a few reasons I love Visual Studio code. 89 00:06:28,500 --> 00:06:34,470 It is free it is open source and it's available for all operating systems whether you're running on 90 00:06:34,470 --> 00:06:36,550 Mac Windows or Linux. 91 00:06:36,570 --> 00:06:43,890 It also has one of the best EDS I've used in a while with a fantastic ecosystem of extensions and themes 92 00:06:44,100 --> 00:06:47,700 allowing you to really customize the editor to fit your needs. 93 00:06:47,760 --> 00:06:52,470 And we're going to do just that with node j s with Visual Studio code. 94 00:06:52,470 --> 00:06:57,900 We can actually debug no J.S. Right inside of the tool which is a great feature. 95 00:06:57,900 --> 00:07:00,390 You don't always see from text editors. 96 00:07:00,390 --> 00:07:04,320 Now there is no reason you have to use visual studio code. 97 00:07:04,320 --> 00:07:05,490 It is just the editor. 98 00:07:05,520 --> 00:07:07,280 I'll be using throughout the class. 99 00:07:07,320 --> 00:07:12,240 You're more than welcome to use any editor you're comfortable with if you already have one that supports 100 00:07:12,270 --> 00:07:14,940 javascript and you're already good to go. 101 00:07:14,940 --> 00:07:20,190 But if you're looking for something new and you want to try out what is a very cool tool I definitely 102 00:07:20,190 --> 00:07:23,120 recommend checking out visual studio code. 103 00:07:23,130 --> 00:07:26,040 Now there are plenty of other options out there as well. 104 00:07:26,100 --> 00:07:29,870 In the past I've used the atom text editor in my classes. 105 00:07:29,880 --> 00:07:36,420 It's also a great free open source editor available for all operating systems and there are some good 106 00:07:36,420 --> 00:07:38,770 paid editors out there as well. 107 00:07:38,790 --> 00:07:43,050 Examples of that would be sublime text 3 and web storm. 108 00:07:43,080 --> 00:07:50,340 Now web storm is definitely more of an IED e than a text editor but it's also a tool worth checking 109 00:07:50,430 --> 00:07:51,210 out. 110 00:07:51,270 --> 00:07:56,700 So all we need is to install one of these if you want to follow along exactly and use these setup I 111 00:07:56,700 --> 00:07:57,150 use. 112 00:07:57,150 --> 00:08:00,120 I recommend installing visual studio code. 113 00:08:00,240 --> 00:08:01,900 So take a moment to get that done. 114 00:08:01,920 --> 00:08:07,590 You can pause the video then come back when you have it installed and we're going to wrap up the course 115 00:08:07,590 --> 00:08:09,480 by just cracking it open. 116 00:08:09,480 --> 00:08:16,080 So I'm going to open up from Spotlight visual studio code and right here we're not going to actually 117 00:08:16,080 --> 00:08:17,640 do anything with the editor. 118 00:08:17,670 --> 00:08:22,170 I just want to make sure we have it installed and we can actually crack it open. 119 00:08:22,290 --> 00:08:23,940 So we have node installed. 120 00:08:23,940 --> 00:08:29,780 We've checked that the command works and we have a text editor where we can now write node scripts. 121 00:08:29,820 --> 00:08:32,310 That is it for this installation video. 122 00:08:32,310 --> 00:08:36,720 We're now ready to continue with the rest of the course in the next two videos. 123 00:08:36,720 --> 00:08:40,920 As I mentioned we're going to focus on answering two important questions. 124 00:08:40,920 --> 00:08:46,310 What is no J S and why is no JSA a tool worth using. 125 00:08:46,350 --> 00:08:48,560 I'm excited to talk about both of those. 126 00:08:48,600 --> 00:08:51,450 So let's go ahead and jump right in to the next one.