How to install and run NodeJS with NPM on Windows and Mac

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey how's it going all the web developers out there my name is norbert bm and i teach web development on this channel in today's video we're going to learn how to install and use node.js and mpm on mac and windows first we're going to go through what npm and node.js are then we're going to install npm in ogs and then i'm going to show you separately how it works on mac and windows actually it's pretty similar but i'm going to note the small differences and at the end we're going to fire up visuals to the code and also run node.js in visual studio codes terminal okay so hope you're excited for the video let's get started so first question is what is npm now npn stand short for node package manager and it is a package manager for javascript programming language maintained by npm inc npm is also the default package manager for the runtime environment called node.js okay so what is node.js then node.js is a runtime built on chrome's v8 engine as a asynchronous event-driven javascript runtime nodejs is designed to build scalable network applications now let's jump into the browser and install node.js now in order to install node.js we need to go to their home page which if you just make an easy search in google you will land on nodejs.org now depending on what kind of operating system you use your web page will automatically recognize your operating system and offer you the necessary version that means mac or windows as you can see here for the installer to download now you can still choose to download a different version if you wish so by going to other downloads so let's click on it and we will be sent to this page also here's where i will answer the question which is probably already bothering you whatever happened to npm you were talking about npm so where is mpm didn't we need npm in order to run node.js well yes we do and if you check your in your upper right corner you will see that npm is included now in the latest version of node.js installer so when you're going to download the installer package for node.js you ultimately also have npm included and this also means when we're going to install them it will install them both now let's download the node.js installer as i said when if you're windows you can download it for windows and for 32 bits or 64 bits again if you are mac os you can download the macros for linux linux and so far and so on so please download it for whichever operating system you're on and then we're going to move on so after a quick download you will be prompted with with the installer package now the installation is pretty straightforward you just click on next accept continue you can choose a different location if you wish i'm going to just choose my typical one install this software and there we go we are done now after we close it up we can move this to trash on windows is basically the same thing now a bit of a difference between windows and mac users macos comes automatically with python installed but windows does not so windows users only windows users out there also use windows don't worry it's just that i'm recording on mac now windows users so don't be surprised if if you start seeing is a command line or a command prompt or powershell opening automatically and starts installing the latest version of python or if you already have partial python installed then it will start updating python this is because mac os comes with python and windows does not come with python okay so after we have installed it now let's use node.js and npm but wait you're now probably wondering if we also check our desktop there is no node.js or npm icon so what just happened as you can remember you didn't get to select if you wish to have a shortcut icon on your desktop or in the start bar so far and so so where are they well node.js and npm actually don't have any ui or user interfaces well quite frankly because they don't need one everything that we do within node.js and npm we actually tell it by typing out specific commands okay so where do we type our commands well it differs for windows and mac users but both operating systems come with a specific place where you can run commands for macos it is the terminal and for windows by default is the command prompt or powershell i would suggest command prompt for windows users but first let's just take a look on mac now all your mac users if you want to launch your terminal you first need to launch your spotlight now i assume that you already know how to launch launch spotlight if you don't know it's command plus space and then just type in terminal let's hit enter and the terminal will open let me just make this a bit larger so you can see what i'm doing okay so how do we know that we have nodejs or npm installed okay stop now back to you windows users you can run your command prompt by either hitting the windows key on your keyboard which will open up your search and just type in cmd and enter that will open up your command prompt so again i would recommend sticking with the basic command prompt for a power user on the other hand then there are plenty of alternatives out there for you okay so let's run mpm and ogs again windows user open up cmd or your command prompt mac users open up your terminal and first of all let's check if we have mpm so just go into your terminal or command prompt tom p m p m space dash v and this will check if we even have npm installed and if we have then what version it is now you can see we have 6.14.15 which should be this version right here okay so we are on a current version now if you're seeing this video later on then most probably there is a newer version out there but don't worry it will still work okay so let me just minimize this now let's check for node if we have that install so node dash space dash v and you we have version 14.18 point which again should be the current version okay now how do we use node.js first of all we need to launch node.js and if you wish to run node.js you just need to type in node and press enter after you do that welcome to node.js and it also give you the version now obviously you can now go further and type in dot help hit enter and then you're going to get a couple of commands if you wish to clear your terminal you know you can press dot clear but for the moment there's nothing to be cleared now if you wish to exit node.js or stopping it from running there are two ways to do that you can either type in exit or hold control on a windows or control on a mac and followed by c okay and we just exit node.js again let's run node enter and type in dot exit and this will also exit node.js okay so let's move on to our next point which is running node.js and npm in visual studio code so let's close up our terminal let's create a folder call it whatever we want i'm just going to call it node and you can either right click and then run visual studio code now after we have visual studio code open we can just drag and drop our folder in there and let me just make it a bit larger and there we go now next up is to actually open up the terminal within visual studio code and yes visual studio code also has a terminal and on mac users you can just type press command tilde or go up to terminal and new terminal and this will open up a terminal in visual studio code now this terminal right here is your integrated terminal now don't be alarmed if you see right here something different that what i see the terminal is basically whatever default terminal you have set for your operating system if you're on windows you can it could be that you see something different like for example bash powershell here but you can always click on this arrows and select a different terminal now if you're on windows you're going to see something different here again command prompt or powershell or whatever default terminal you have installed and also now a short plug if you wish to improve upon your visual studio code skills then you can check out my complete course on visual studio code the link is down in the description below so feel free to go ahead and check it out if you wish so now that we have our terminal opened we can actually execute exactly the same commands as we did before so i can check for mpm v this will give me the version i can check for node space dash v this will give me the version of node.js and i can run node.js by typing node hit enter and again we are in node and i can stop node ctrl c control or control d or type in let's run it again node.js and type in exit and there we go so that's all for how to run nodejs if you enjoyed the video give it a thumbs up if you didn't give it a thumbs down if you're new to the channel then please consider subscribing because i post new videos like this on a weekly basis also click that notification bell in order to get notified whenever i post a new video now if you have any kind of questions or suggestions please leave them in the comment section below and with this being said thank you so much for your attention and furthermore i would suggest that you take a look at these two videos the first one being top 10 tips for beginner web developers where i gave you my personal top 10 tips for starting your career as a web developer and the second one is how to set up visuals to the code for beginners where you will learn how to run html css in javascript in visual studio code by setting up visual studio code with the most powerful extensions out there okay thank you so much for watching catch you next time bye [Music]
Info
Channel: Norbert BM Web Development
Views: 68
Rating: undefined out of 5
Keywords: Norbert BM Web Development, node js, node js tutorial, how to install node js, how to install node js in windows 10, how to install nodejs on windows 10, how to install node js in visual studio code, how to install nodejs on mac, how to run node js in cmd, how to run node js in mac, node js crash course, node js tutorial for beginners, node js tutorials
Id: yM92Iuh35JY
Channel Id: undefined
Length: 10min 58sec (658 seconds)
Published: Wed Oct 27 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.