English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

NodeJS Basic Tutorial

NodeJS Express.js

NodeJS Buffer & URL;

NodeJS MySql

NodeJS MongoDB

NodeJS File (FS)

Other NodeJS

Node.js Installation on Ubuntu Linux

The installation of Node.js is a simple task. We just need the correct steps. In this tutorial, we will learn to set up the environment for Node.js and the prerequisites for starting to develop Node.js applications.

The JavaScript programming language is used for Node.js application development. The source file extension for Node.js applications is “.js”. Any text editor is sufficient to write Node.js code and save it as a .js file. To interpret the instructions written in the source .js file, a Node.js interpreter is required. Node.js can be provided as a binary distribution.

Install Node.js Binary Distribution

From [https://nodejs.org/download/release/latest/]Download the latest binary distribution. According to the operating system and architecture, download the appropriate software package. The size will be less than20MB.

The following is the latest software package for writing this tutorial (for x64The latest software package available when ()

OSPackage
Linuxnode-v8.4.0-linux-x64.tar.gz
MacOSnode-v8.4.0-darwin-x64.tar.gz
Windowsnode-v8.4.0-win-x64.zip
SunOSnode-v8.4.0-sunos-x64.tar.gz

For operating systems based on the Linux kernel, such as Ubuntu / MacOS / SunOS

After the download is complete, unzip the software package and include it in the system path variable.

Go to the downloaded folder, open the terminal here, and execute the following command.

Unzip the compressed package

 $ export PATH=$PATH:/usr/local/nodejs/bin

After adding the route, please close the terminal and then reopen it.

To verify if the nodejs path has been added to the PATH environment variable, please run the following command:

console.log("Hi there! This is Node.js!")

And run the following command from the command prompt or terminal in the verifyNode.js script file directory.

$ node verifyNode.js 
Hi there! This is Node.js!

Running Node.js Files

The following is the syntax for running Node.js files using the Node command-line interface:

~$ node <file_name>

Conclusion

In this Node.js tutorial, we learned how to install Node.js on a computer and verify the installation by executing the example script (.js) file.