In this web development tutorial you are going to learn what NodeJS is and how to install bought NPM and NodeJS on the operating system of your choice, Mac or Windows.
Buy me a Coffe
Hi, if you like my content and you wish to give back you can buy me a Coffe!
Buy me a Pizza
Hi, if you like my content and you wish to give back you can buy me a Pizza!
What is NPM ?
What is NodeJS ?
Let’s install Node.js
In order to install Node.js we need to go to there homepage. Now depending on what kind of operating system you are the webpage will automatically recognize you OS and offer you the necessary version (this means Mac or Windows version) of the installer to download. Now you can still chose to download any athor version if you wish so, by going to Other Downloads.
Also here is where I will answer the question witch is probably already bothering you. What ever happened to npm, did dent we need npm in order to run Node.js? Yes we do, and if you check the upper right corner of the page you will se that the Node.js installer will also include the latest version of npm.
Now let’s download and install
After a quick download you can now go ahead and instal Node.js. The installation process is pretty strate forverd and just after a couple of seconds you are good to go and can start using node.js.
Now a bitt of a difference between Windows and Mac users. Mac OS comes automatically with Python installed but windows dose not. So windows users don`t be surprised if you start seeing cmd or powershell opening up automatically and starts installing the latest version of Python or if you already have it installed it will start updating it.
Let’s use NodeJS and NPM
Now that we have node.js and npm installed you are probably wondering where there are? You did`t get to select if you wish to have a shortcut icon for you desktop or start bar. So where are they?
NodeJS and npm actually don’t have any
UI (user interfaces), wall quit frankly because they don’t need one. Everything that we do with nodejs and npm we actually tall them by
typing out specific
OK, so where do you type your commends. It differs for Windows user and Mac user.
Run NodeJS and NPM on Mac
Run NodeJS and NPM on Windows
For Windows user you will need your command prompt or powershell. I would recommend sticking with the basic command prompt for regular user, if you are a power user on the other hand then there are plenty of alternative options out there.
Let’s run NodeJS and NPM
Now open up your cmd for Windows user or your terminal for Mac users and type in npm -v. This will give you the current version of npm that you installed. The same gos for node -v, this commend will tel you witch version of node.js you have installed.
Now in order to
run Node.js you just need to type in node and press enter, and Welcome to Node.js with the current version will aper.You can go further and type in
.help for more information.
In order to
stop Node.js from running you can either type in
.exit or hold ctr on wind or cmd on the mac and then press the
d key, and this will also stop node.js from running.
Running NodeJS and NPM in VS Code (Visual Studio Code)
As a last point, I want to show all you Visual Studio Code users, how to run Node.js in VS Code. First let’s create a folder, just create one on your desktop, name it whatever you wish, then open it up with visual studio code.
Now we need a terminal in order to run node.js, so let’s to the top, click on terminal and new terminal. This will open up your integrated terminal in visual studio code, now don`t be alarmed if you see hear a different terminal then what I have, as I sad, this depends on what kind of OS you are using and if you have installed more then one terminal, but you can always change them by clicking on the little arrow down and selecting you desired terminal. This honestly also confused me in the beginning when I started using VS Code.
Short plug, if wish to improve upon your VS Code skills then check out my Complete Course on VS Code link is … or any of my other courser on my website.
Now that we have our terminal open we can execute exactly the same commands as we did before.