Node.js – Environment Set up
Before proceeding with more details of Node.js, I would like to give some basic definition for Node.js.
Let us see environmental set up of Node.js. Here is good news, if you want to learn Node.js, you really don’t need to set up anything on local.
Node.js gives you very good facility by giving their environmental set up online. You are free to modify any example and execute online only.
So that you can update your theory knowledge with practical examples. You can check each and every example with different options so that you can enjoy learning.
Still some people are very much comfortable with local environmental set up.Lets have look how we can use Node.js locally. You need following softwares available on your computer.
- Text Editor :
Text editor can vary based on different operating systems and based on you on which you are comfortable.
There are many editors available such as Notepad, Sublime, OS edit command, vim or vi, EMACS, Brief, Epsilon etc.
Few editors are used on multiple OS such as Notepad can be used on Windows and Vim or vi will be used on Linux or UNIX as well Windows.
Make sure that you have proper text editor installed on your system and you are used to do programming on that so that it will save your time and you can execute your programs without any headache.
When you write any code in file in editor that are known as Source files which contain program source code.
Node.js files are basically named with “.js” extension.
- The Node.js binary installables:
Node.js provides binary installable for Windows operating systems for 32-bit (386) as well 64-bit (amd64) x86 processor architectures. It also gives facility for Linux, SunOS , Mac OS X.
Let us look at how to install Node.js binary distribution on various OS.
#Installation on Windows:
1) Download latest version of Node.js from https://nodejs.org/en/
2) After downloading, you will get application file that you need to Run.
3) You will see step by step installation wizard where Accept the terms of license agreement and Choose the location where you want to install.
In this way, you will complete installation on Windows.
#Installation on Ubuntu/Linux/CentOS:
1) Go to Ubuntu Terminal
2) Command Sudo apt-get install python-software-properties
3) If you have password for your system then it will ask for the password
4) Type password and enter
5) Next command sudo apt-add-repository ppa:chris-lea/node.js
6) Then press Enter
7) Again Press Enter to continue
8) Now type command sudo apt-get update
9) Command sudo apt-get install nodejs npm
10) Next command is sudo apt-get install nodejs
Installation completed. Now you can check the version of Node by node –version
check the version of npm : npm -v