What exactly is NodeJs?
To develop a project with NodeJs, having an additional framework is advisable to that can use Node.js methodologies like Express.js and Koa.js
Ways To Install NodeJs On Your Machine
1) The .MSI (Installer Wizard)
Download a .MSI installer from the official site according to your machine configuration. With .MSI installer, everything will automatically be set up including environment variable.
But keep a note that you cannot change through the versions and if you do, then you would be required to run the installer again.
2) Node Version Manager (NVM)
It is another way to setup node locally. NVM is advantageous if you are frequently switching between the node versions and is highly recommended to the deployment team. Installing it is much easier if you are using a Window’s PC otherwise, you might need to run through different errands to get it installed on your PC.
Note: Setup NVM before Installing NodeJs.
If you’re switching the versions, you need to reinstall the global modules earlier installed on your PC. Furthermore, you should be aware of commands related to CLI.
3) Compiled Source
If you are looking for all the latest from the core team of NodeJs, download its compiled sourced directly from Github.
Note: Though you have the latest code, you would require to compile it manually on your machine. It takes longer than .MSI and NVM to build and deploy the code manually. It is not supportive to frequent version change as each time you change the version; it needs reprocessing regarding compilation, build and deployment.
Now, it’s the time to test it:
Ensure that you have NPM & Node installed with the help of simple commands to see the versions to run a test:
If you want to see if the Node is installed:
- Open the Windows Powershell, Command Prompt or a similar command line tool.
- Type node -v. It’ll print a version number and you may see something like v0.10.35.
- If you want to see if NPM is installed:
- Type npm -v in Terminal.
- It should print NPM’s version number and you’ll see something like 1.4.28
- name it hello.js
- add the code console.log(‘Node is installed!’)
- Run the code simply.
- Open your command line program
- Navigate to the folder where you save the file and type node hello.js. This whole process will start Node and run the code in the hello.js file.
- Now, You should see the installed output Node.
In the end, everything is up to you to choose the method of installing NodeJs as per different choice suitable the best to your working environment. If you could share some more techniques to install NodeJs, it’ll help our readers and us. Comment!
Author Bio :
Sophia Phillips is an expert frond-end & WordPress developer. Currently, she is employed with WordPrax Ltd.- a leading PSD to WordPress theme converter company. Sophia has had written a remarkable number of articles on WordPress tricks and tips.
- AngularJS Vs jQuery – A Good Comparison
- A Complete Guide About the Advantages of HTML5 and CSS3
- HTML5 for Mobile Application Development
- Top 20 resources you need to master HTML5 Canvas
- ASP.NET MVC3 Vs MVC4 Vs MVC5 Vs MVC6
- Understanding Model-First Approach in ASP.NET MVC with Entity Framework
- 7 jQuery Code Snippets every Web Developer must Know