Practical introduction to Nodejs: Installing and learning NodeJS on Debian and Ubuntu

PHP is the world’s most used programming language for websites despite experienced developers admit the superiority of other languages like NodeJS or Ruby on rails for web applications.

Node JS is based on JavaScript, it is faster than PHP and has very better performance with interactive applications. The language Nodejs is easy to learn and even more if you already know a little of JavaScript.

In this tutorial you’ll get explained how to install Node JS on Debian and Ubuntu. If you don’t have previous knowledge on JavaScript basics avoid reading the section of this article called “NodeSchool: learn Node JS easy”, when reaching that section omit it and go directly to the next one called “Javascript on NodeSchool”.

To install NodeJS run:

apt install nodejs

You can run nodejs -v to make sure you installed it properly.

Node JS uses npm as default package manager. Type npm to see if you have it installed:

If you get an error instead of npm’s man page run:

apt install npm

Let’s check the npm packages manager installing MongoDB, first of all, create a directory dedicated to NodeJS (create it by running mkdir< DIRECTORYNAME>). Before using npm we need to start a new project and setup a package.json, a package.json must contain it’s name, description, version, link, keywords, author and license. To start a new project run:

npm init

Fill the required fields and end the installation, then type:

npm install mongodb

In my case it was previously installed so it only updated a package. As you can see the basic syntax is easy as apt.

NodeSchool: learn Node JS easy:

NodeSchool is a great multilingual website to learn Nodejs development. If you don’t know JavaScript you may want to avoid the next steps and go directly to the end of the article to see the way to get started with JavaScript before trying Nodejs.

To get started with the Nodejs’ tutorial install learnyounode by running:

npm install -g learnyounode

The parameter -g instructs a global installation, a Nodejs global installation will install the package as global module, otherwise the installation would be only for the current project.

After installing learnyounode run it by typing in the terminal:


This menu is the workshopper menu, you can start by hitting ENTER at HELLO WORLD and follow the instructions to get started with Nodejs.

Javascript on NodeSchool

At NodeSchool we can also learn JavaScript and HTML. To get started with NodeJS is better to have previous knowledge on JavaScript, after installing nmp install the workshopper for JavaScript by typing:

npm install -g javascripting

Note: The parameter -g instructs a global installation, a Nodejs global installation will install the package as global module, otherwise the installation would be only for the current project.

Then run


The JavaScripting menu will guide you through the course to get started with JavaScript, press ENTER on the introduction to get started and follow the instructions.

I hope you found helpful this article to get started with Nodejs, a very powerful language for web programming. Keep following LinuxHint for more tips and updates on Linux.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

NodeJS with Redis

Redis is widely used as a caching server. At times, Redis is used as a database as well. It stores the data in a computer’s...

PostgreSQL NodeJS Tutorial

Using PostgreSQL from Node.js PostgreSQL is a very popular open source database. It is widely used for almost all types...

Node.js Send E-Mail with Attachment

Node.js is the server side JavaScript engine that is loved by web developers and system administrators all over the world....
Bài Viết

Bài Viết Mới Cập Nhật

mua Proxy riêng ở đâu, và nó đem lại lợi ích gì cho người sử dụng

Hướng dẫn sử dụng Proxy Helper Fakeip khi thuê proxy


Mua Proxy Nuôi Zalo Giá Rẻ Tại