Tutorial Outline
- What is Node.js?
- Install curl command in Linux machine
- Installation of Node.js and NPM
- Installation of live-server for Web Development
What is Node.js?
"Node.js" is a "JavaScript runtime environment", built on "Chrome's V8 JavaScript Engine". Node.js is an open-source, cross-platform, JavaScript runtime environment / framework that executes "JavaScript code" outside of a "Web browser".
"Node.js" lets "coders" /"developers" use "JavaScript" to write "command line tools" and for "server-side scripting", running scripts server-side to produce "dynamic web page" content before the page is sent to the user's web browser.
• Node.js is free.
• Node.js runs on various platforms. For Example: Windows, Linux, UNIX, Mac OS, etc.
• Node.js uses JavaScript on the Server.
• Node.js runs on various platforms. For Example: Windows, Linux, UNIX, Mac OS, etc.
• Node.js uses JavaScript on the Server.
How To Install Curl Command In Linux Machine
This works on all the debian destributions of Linux OS, like: Ubuntu, Mint, Kali, Zorin OS, etc.
The procedure to install cURL command on Linux machine / system is as follows:
1. Firstly, connect your Linux machine / system via Internet.
2. Now, open a new terminal from the Linux application menu / dash menu or by using shortcut command "Ctrl + Alt + T".
3. Now, update your package indexes by using the following command:
$ sudo apt-get update [press the Enter key]
4. Next, type your "sudo password", when prompted.
5. Now, install cURL command, please execute:
$ sudo apt-get install curl [press the Enter key]
The procedure to install cURL command on Linux machine / system is as follows:
1. Firstly, connect your Linux machine / system via Internet.
2. Now, open a new terminal from the Linux application menu / dash menu or by using shortcut command "Ctrl + Alt + T".
3. Now, update your package indexes by using the following command:
$ sudo apt-get update [press the Enter key]
4. Next, type your "sudo password", when prompted.
5. Now, install cURL command, please execute:
$ sudo apt-get install curl [press the Enter key]
Verify Installed cURL Command Version
Verify installed version of the cURL command on your Linux machine, by executing:
$ curl –version [press the Enter key]
$ curl –version [press the Enter key]
Installation Of Node.js And NPM
Installation On Linux Machine / System
Node.js is one of the most popular web techonlogies to build network applications quickly. In this tutorial, we will learn, how to install Node.js and NPM on Linux machine / system. We need to add Node.js 12 PPA command to our Linux Ubuntu 18.04 LTS, 16.04 LTS and 14.04 LTS. Same instructions we can apply for any Debian based Linux destribution. Such as, Ubuntu, Kubuntu, Mint, Kali, Zorin OS, etc.
This is the simplest method to install a specific version of Node.js on our Linux machine / system. To install Node.js and NPM from its PPA command, please follow the steps given below:
1. Connect your Linux machine / system via Internet.
2. Open your terminal from the Linux application menu / dash menu or by using shortcut command "ctrl + alt + t".
3. Now, add the following Node.js 12 PPA to your Linux system to install Node.js 12 on your Linux system:
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - [press the Enter key]
Note: If you want to install any other version of Node.js, please change the version number. Such as, 12.x, 10.x, 13.x, etc.
4. Once the Node.js 12 PPA is enabled, please install Node.js 12 by using the "apt-get" command. This will also install the NPM with Node.js. Also, it will install the many other dependent packages on your Linux system:
$ sudo apt-get install -y nodejs [press the Enter key]
5. Next enter your "sudo password", when prompted and hit the Enter key.
6. Finally, Node.js 12 and NPM successfully installed in your Linux system.
This is the simplest method to install a specific version of Node.js on our Linux machine / system. To install Node.js and NPM from its PPA command, please follow the steps given below:
1. Connect your Linux machine / system via Internet.
2. Open your terminal from the Linux application menu / dash menu or by using shortcut command "ctrl + alt + t".
3. Now, add the following Node.js 12 PPA to your Linux system to install Node.js 12 on your Linux system:
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - [press the Enter key]
Note: If you want to install any other version of Node.js, please change the version number. Such as, 12.x, 10.x, 13.x, etc.
4. Once the Node.js 12 PPA is enabled, please install Node.js 12 by using the "apt-get" command. This will also install the NPM with Node.js. Also, it will install the many other dependent packages on your Linux system:
$ sudo apt-get install -y nodejs [press the Enter key]
5. Next enter your "sudo password", when prompted and hit the Enter key.
6. Finally, Node.js 12 and NPM successfully installed in your Linux system.
Verify The Installed Version Of Node.js and NPM
You can check and verify the installed version of Node.js and NPM by executing the following command in your terminal:
$ node -v [press the Enter key]
OR
$ node --version [press the Enter key]
Similarly, you can also verify the NPM version by executing the following command in your terminal:
$ npm -v [press the Enter key]
OR
$ npm --version [press the Enter key]
$ node -v [press the Enter key]
OR
$ node --version [press the Enter key]
Similarly, you can also verify the NPM version by executing the following command in your terminal:
$ npm -v [press the Enter key]
OR
$ npm --version [press the Enter key]
Installation On Windows Machine / System
1. Connect your Windows machine via Internet.
2. Open your favourite Web browser, and naviagte to "https://nodejs.org/en/download/"
3. Now, click on the "Windows Installer" button to download the default version of Node.js.
Note:
• At the time, this article was written, "Node.js 12.16.1-x64" was the latest version.
• The "Node.js Installer" includes the "NPM".
• There are other versions available. If you have an older machine / system, you may need the "x86 / 32-bit" version. You can also use the top link to switch from the "stable LTS" version to current version.
4. Once the "Node.js Installer" finishes downloading, launch it.
5. Open the "Downloads" link in your "web browser" and click the "downloaded file".
OR
Navigate to the location, where you saved the "Node.js Installer" file and double-click it to launch.
6. Now, the system will ask, if you want to run the software. Click "Run".
7. Next, you will be Welcomed to the "Node.js Setup Wizard". Click "Next" to proceed.
8. On the next screen, please review the "license agreement". Click "Next", if you agree to the terms and install the software.
9. Now, the "Node.js Installer" will prompt you for the "Installation location". Leave the "default location", unless you have a specific need to install it somewhere else, then click "Next".
10. The wizard will let you select the "components" to include / remove the installation. Again, unless you have a specific need, accept the "default" by clicking "Next".
2. Open your favourite Web browser, and naviagte to "https://nodejs.org/en/download/"
3. Now, click on the "Windows Installer" button to download the default version of Node.js.
Note:
• At the time, this article was written, "Node.js 12.16.1-x64" was the latest version.
• The "Node.js Installer" includes the "NPM".
• There are other versions available. If you have an older machine / system, you may need the "x86 / 32-bit" version. You can also use the top link to switch from the "stable LTS" version to current version.
4. Once the "Node.js Installer" finishes downloading, launch it.
5. Open the "Downloads" link in your "web browser" and click the "downloaded file".
OR
Navigate to the location, where you saved the "Node.js Installer" file and double-click it to launch.
6. Now, the system will ask, if you want to run the software. Click "Run".
7. Next, you will be Welcomed to the "Node.js Setup Wizard". Click "Next" to proceed.
8. On the next screen, please review the "license agreement". Click "Next", if you agree to the terms and install the software.
9. Now, the "Node.js Installer" will prompt you for the "Installation location". Leave the "default location", unless you have a specific need to install it somewhere else, then click "Next".
10. The wizard will let you select the "components" to include / remove the installation. Again, unless you have a specific need, accept the "default" by clicking "Next".
Verify The Node.js And NPM Installation
1. Press the "Win + r" key to open "Run" command and type in "cmd" and hit the "Enter" key.
OR
Click on "Start menu" button and open the "Command Prompt" (cmd).
2. Now, to check and verify the installed "Node.js" version, execute the following command in your "Command Prompt" (cmd):
node -v [press the Enter key]
3. You can do the same for NPM:
npm -v [press the Enter key]
OR
Click on "Start menu" button and open the "Command Prompt" (cmd).
2. Now, to check and verify the installed "Node.js" version, execute the following command in your "Command Prompt" (cmd):
node -v [press the Enter key]
3. You can do the same for NPM:
npm -v [press the Enter key]
How To Uninstall / Remove The Installed Node.js Ans NPM From Windows Machine
You can "uninstall" / "remove" the "Node.js" and "NPM" from the "Control Panel" in "Windows Machine".
To do so
1. Click the "Start menu" button > "Settings" [the gear icon] > "Apps".
2. Scroll-down to find the "Node.js" and click to "highlight".
3. Select "Uninstall". This launches a wizard to uninstall the software.
To do so
1. Click the "Start menu" button > "Settings" [the gear icon] > "Apps".
2. Scroll-down to find the "Node.js" and click to "highlight".
3. Select "Uninstall". This launches a wizard to uninstall the software.
Installation of live-server for Web Development
What is live-server?
- This is a "little development server" with "live reload" capability. Use it for hacking your HTML / CSS / JavaScript files. But, not for deploying the final site.
- You don't need to install any browser plugins / manually add code snippets to your pages for the "reload functionality" to work.
- You need "Node.js" and "NPM". You should probably install this globally.
Install Using NPM Method
1. Connect your Linux / Windows machine via Internet / wi-fi connection.
2. Open a new "terminal" / "command prompt" (cmd).
3. Now, execute the following command to install the "live-server":
Linux OS
$ sudo npm install -g live-server [press the Enter key]
Enter your "sudo password" and hit the "Enter"key.
Windows OS
$ npm install -g live-server [press the Enter key]
2. Open a new "terminal" / "command prompt" (cmd).
3. Now, execute the following command to install the "live-server":
Linux OS
$ sudo npm install -g live-server [press the Enter key]
Enter your "sudo password" and hit the "Enter"key.
Windows OS
$ npm install -g live-server [press the Enter key]
How To Use live-server
Linux OS
1. Open a new "terminal" from the "Linux application menu" / "Dash menu" or by using the shortcut command "ctrl + alt + t".
2. Now, move your "terminal" to where your page live:
$ cd "path-to-content" [press the Enter key]
3. Next, Start the "live-server":
$ live-server --port="port-no." [press the Enter key]
Note: Note that, don't give the port number, "8080" / less than "3000". It would be a good practice for you to use port number "9000".
Example:
$ live-server --port=9000 [press the Enter key]
Windows OS
1. Press the "Win + r" key to open "Run" cpmmand.
2. Type in, "cmd" and hit the "Enter" key.
3. Now, move your "cmd" to where your page live:
cd "path-to-content" [press the Enter key]
4. Next, Start the "live-server":
live-server --port="port-no." [press the Enter key]
Note: Note that, don't give the port number, "8080" / less than "3000". It would be a good practice for you to use port number "9000".
Example:
live-server --port=9000 [press the Enter key]
1. Open a new "terminal" from the "Linux application menu" / "Dash menu" or by using the shortcut command "ctrl + alt + t".
2. Now, move your "terminal" to where your page live:
$ cd "path-to-content" [press the Enter key]
3. Next, Start the "live-server":
$ live-server --port="port-no." [press the Enter key]
Note: Note that, don't give the port number, "8080" / less than "3000". It would be a good practice for you to use port number "9000".
Example:
$ live-server --port=9000 [press the Enter key]
Windows OS
1. Press the "Win + r" key to open "Run" cpmmand.
2. Type in, "cmd" and hit the "Enter" key.
3. Now, move your "cmd" to where your page live:
cd "path-to-content" [press the Enter key]
4. Next, Start the "live-server":
live-server --port="port-no." [press the Enter key]
Note: Note that, don't give the port number, "8080" / less than "3000". It would be a good practice for you to use port number "9000".
Example:
live-server --port=9000 [press the Enter key]
My book Pracheen Vishva Ki Pramukh Nadi Ghati Sabhaytayein/प्राचीन विश्व की प्रमुख नदी घाटी सभ्यताएं (Hindi Edition) Kindle Edition
How To Install Python In Linux System (Hindi)
Lost Administraror Rights To The One And Only Account In Windows 10
2 Comments
we are top Mobile App Development Company in Delhi.
ReplyDeleteThnak For Sharing.
ReplyDeleteNode JS Online Training