Installing NODE.js in a MAC

Edwin Diaz
A free video tutorial from Edwin Diaz
Web Developer & Premium Udemy Instructor - 600,000 students
4.5 instructor rating • 47 courses • 674,584 students

Learn more from the full course

Node.js for Beginners - Become a Node js Developer + Project

Build an Amazing CMS system - Using Express + MongoDB + Bootstrap - Handlebars + Authentication + AJAX + Deployment

23:10:46 of on-demand video • Updated April 2020

  • To build Amazing NodeJS applications like the CMS we build here using Express, MongoDB and more
  • To deploy Nodejs Apps on the Cloud
  • To create Login and Registration system using NodeJS
  • To use Mongoose (ODM) - very similar to ORM
  • To create custom events
  • To import and export data
  • To use the Express FrameWork
  • To handle HTTP requests
  • To deal with Files
  • To use WebSockets - (Chat application)
  • To use PassportJS a module to login to Facebook, Twitter, Google and more
  • To use Template Engines like Handlebars
  • And LOTS more.......
English [Auto] Welcome back these students in this lecture we are going to be installing no J.S. in a Mac operating system if you have a Windows computer jumped to the next lecture. OK so we're going to learn a couple of different things here. First of all we're going to download no install it and add it to our path in our computers so we can find it very easily. So for those of you that have no. Just make sure that you have it by typing in node. I think hyphen version in your terminal. Now if you don't know what your terminal is or where it is. Make sure that you are to launchpad and type in terminal there and termino is where we secure our programs directly in our computer. OK. And for taking this course chances are that you already know what it is. But I'm always saying that because this is a beginner's course. So I'm always taking it all the way down to the beginner's level. OK. So if you don't see anything you're no. And you don't see anything there is because you don't have node or he's not in your path and I'll show you that later on without means. OK. Basically we can't find it like that. Now we can also try to find it by going to use your local bin directory and we can send you a CD and they're going to show you. BASH a bunch of commands here just as simple ones as you can. If you don't already know so we can go to that user bin directory here. And this is where all your executed was located at LS And you can see that we have a whole bunch of different programs here. Let's clear that out. And if I typing LS hyphen L.A. we can see more stuff. But anyway I need to clear that out so this is where all these executables are located. If I go there and I try to look for node I can see that I already have it installed. So is is dumb. You know this is alphabetically ordered. So if you look after the M You can see the ends and if it is not there then and you don't have it. If he's there you have it. And you can really find out what version you have by typing in user local been like this and actually know having hiving version just like this enter. And you can see that you have white version you have. If you have a really old version I suggest you go to their Web site like we were and we are going to do it now and downloading the newer version the newer version that will override the old version. OK. All right. So that's done there let's go and download no yes. For those of you that don't have it or for those of you don't want to update it. No. Jay is that org. Is the Web site Antar. And as you can see we have two links here. The current version which is the current version that I have that we have available now if you have a higher version. Do not worry this course is always of data it is not a cause that's going to get outdated because we are always using the core foundations of knowledge yes. Right. Which is very rarely changed. OK. So Corum version or the most stable version which is older always. We're going to download the most current version. I'm going to download this again even though I have it because I want to show you step by step how this is done. I need to save it. I'm going to go to the installer and tell me where he's going to install the ains Ptolemy's also is installed 8 pm which is nold package manager. This little program here and you're going to see this later on helps us download packages for our node applications. It would download our packages and we can use included in our files or scripts. OK I'll show you that later. So we're going to follow the prompt. I agree stoled my password here. And then done stoled and install and this is where it is installing it. And just like I showed you in the beginning. So now you can go to that path just like we did before a couple of seconds ago and you can verify that it is there. Or you can type in what I showed you and you should see a version there. OK I'm pressing my up arrow key to go to the next command and my down arrow keys. OK if you have it in your path of course if you're typing no you can get it like this. OK. Anyway so so we see that we don't have it available like this. We should be able to Taiping node and see it. So in order to get this working we need to add the path. This directory this path to our path variable in our computers or computer can find executable for node or any other executable we find in that bin folder. OK. A firewall Mongul Mongo or Mongul D. OK. You can see that it's not working. Even though I have these programs in my it's a beautiful in my user bin folder. Not working just because my computer does not know where it is. So in order for us to add that we need to do a couple of things. Well we can do it in two different ways. We either added to the path file and the path file is in here. So I'm going to type in pseudo Let's clear this out so pseudo for superuser and then always the editor that I'm going to use which is pre-build pre-build editor for Mac and I'm going to go to see hyphen. I mean for Slash it see path into my password. And now you can see here that I have some lines of code here. If you don't have this path you don't have this file and N.A. will create it for you automatically so don't worry if you don't have anything here. Do not worry. So I'm going to add that path user for the U. S are ok. Local bin just like that. Control apps to save and why. Yes. Right here you can see that we've got no. For no and wife. Yes. I'm going to press. Yes. Which is why an answer. OK. Now no should be available if I Taiping No it doesn't work right. But that means that I have to open another terminal to kind of refresh this. So I'm just going to close all that and not find another terminal. Any fights happening. No. You can see that it gives me another prompt. That means that I mean I did not program now. So if I type in let's say No. 1 plus 1 enter it gives me two. What about 245 times 345 or 354. So 345 by 354 enter. That is what I get. So I'm able to play around with programs here. What about variable House. House is my house. Don't worry about when I'm writing it says undented 535 typing house. Now you can see that I was able to save this variable there and when it's happening How's the No. Well will return to me to a value which is pretty cool stuff. Now I can grab the value and put something else in there. Let's say I love this house. Enter And now of Taiping house you can see that I get that. But anyway that's out of there. We're not going to be playing around with our control C Control C. Let's get out of this real quick. So that's the Mongo show. I mean now the Mongols shole the no shell. So if I Taiping Mongul the here you see that that program is working now. Right now control C to get out and turn that off in clear. So all my programs on my executable are located in the directory of user bin local been here all this execute who is working now just because I was able to add this path right here. OK. So this is how you do that. Now there is another way of doing it. And guys I know if you don't have to stay here too. You don't have to actually learn this to continue with the Course so you're welcome to to escape this. This is just extra stuff that I wanted to show you. So another way of doing this OK is by creating a file called Dot bash. If you don't have it we'll find out profile and this files is supposed to be in your user in your home directory in your user directory or their home directory. You can get to it by typing see the till date which is a key locator on the escape key symbol so see the tail that PWT for current directory listing as you can see we have the directory. This is our home directory and you find typing LS. I don't see anything there that has to do with the bash profile. But if I typing ls in L.A. now I can see that dot system files with the dot notation in the front. You see the dot. So now I can see this file here. If you don't have it you need to create it in order for us for this to work. Again you don't need this for this course. But if I typing Nan on the editor. Bash on this core profile. If you don't have it it will create it enter. I have it. So now is another way of kind of not hacking it but making sure that a path variable works. So a path for secuity was are included. So this is how we can do it here and is bash profile. This bash profile file can be used to do a lot of things. I'll show you some of my aliases that I got. So in the command prompt if I tappings zap this would take me this we'll go and see the application zem HD docs it would take me to this specific location instead of me typing this manually every time I could just make an alias and typing zap. Ok I'll show you that right here. So zap Z I hd docs now. So that's why I create. I loved abash profile. OK. So here to do the to change that to this path to our variable path. I would say path equals symbol quotes. I don't believe you need to use cold quotes. But I do and dollar symbol or upper case path colon. And then hopefully I get this right the first time. Then we type in the path right. Been simple. Now control x and y for you for yes done. Now I kynges. Let's actually go and take this off from the from the pass. Let's just comment this out command the symbol command three. My keyboard command control x and y for us to get out. There we go. So now this will work no matter what. So now if I Taiping node it works node Hi. Hi version it works. Let's go back to that file again. Profile and I'm going to comment this out with a number symbol there in front of it on troll x y for yes I'm going to get out of here. Open a new terminal and typing node and you see that it doesn't work. OK. Now which should you use. I like to use put that in the past myself past path's file. So I'm going to go back here. Uncommanded out I have it like this but you don't have to. It's easier to have a make sure fire and not mess around with a pass file just to have something like this so you can modify things in your computer. OK. Use easier instead of more refined directly but I use to make it easier. I put it in the past variable there so I always have it. So now I can execute my notes from anywhere. OK. Now of course this now work you have to come back here. There we go. All right. Anyway thank you so much for watching. Hopefully this taught you a couple of things that you do not know. And I'll see you in the next lecture and the next lecture we're going to see how we do this with Windows. Take your.