This article would cover up the NodeJs installation stuffs. But before you start, I would recommend to read previous article - what the hell NodeJS is.
Okay let's get started now!
There are 3 different ways you can install NodeJs on your machine but it really depends which is more suitable as per your project need. So, let's see all one by one.
3 Different Ways to Install Nodejs on Your Machine
- The .MSI (Installer Wizard)
- Node Version Manager (NVM)
- Compiled Source (Official NodeJs on Github)
The .MSI (Installer Wizard)
You can download .MSI installer from the official site as per your machine configuration. The installer is designed to set up all things automatically including environment variable and this is the most recommended way to install NodeJs on your PC.
- You cannot change through the versions easily. If you want to switch then you have to rerun the installer.
Node Version Manager (NVM)
Node Version Manager (NVM) is another way you can setup node locally. NVM is beneficial if you have to switch Node versions frequently. Also it is recommended for deployment team.
If you use Windows PC then you can head over to nvm-windows, which allows you to install NVM using wizard.
- Before actual installation of Node you need to set up NVM first.
- Also, whenever you switch the version, you have to re-install previously installed global modules.
- Moreover, you need to be familiar with CLI related commands.
Compiled Source (Official NodeJs on Github)
- You would download the latest code from the core NodeJs team, but you have to compile it manually in your machine.
- Also, it would take longer than .MSI and NVM as you have to build and deploy the code manually.
- It is not suitable if your project requires frequent version change, because each time you change the version, it needs to be reprocessed in terms of compilation, build and deployment.
Well! Finally, everything is upto you. As a frontend developer, I would prefer the most easiest way and that's .MSI wizard installation. You may have different choice suitable the best to your working environment.
If you could share more ways to install NodeJs, it would be great help to the community. Kindly add your comments below in comment section.