• Home
  • VPS Servers
  • Dedicated Server Slices
  • Shared Web Hosting
  • About Us
  • Support
  • Contact
  • Blog
  • Client Login
  • VM Admin
VPS City
  • Home
  • VPS Servers
  • Dedicated Server Slices
  • Shared Web Hosting
  • About Us
  • Support
  • Contact
  • Blog
  • Client Login
  • VM Admin

NodeJS install on Ubuntu 16.04 LTS (Xenial Xerus)

Jan 13, 2017Gabriel MoldoveanuCloud Servers, Dedicated Servers, Operating Systems, VPS Hosting0 Comment

Node.js is an open-source, cross-platform JavaScript runtime environment for developing a diverse variety of tools and applications. Although Node.js is not a JavaScript framework, many of its basic modules are written in JavaScript, and developers can write new modules in JavaScript. The runtime environment interprets JavaScript using Google’s V8 JavaScript engine.

— Wikipedia

For this installation and future NodeJS upgrades we will use npm.

npm consists of a command line client that interacts with a remote registry. It allows users to consume and distribute JavaScript modules that are available on the registry. Packages on the registry are in CommonJS format and include a metadata file in JSON format. Over 280,000 packages are available on the main npm registry.

— Wikipedia

If this is a fresh Ubuntu install,
go ahead and enable and secure your OpenSSH server on Ubuntu 16.04 LTS
Login to your server and pull the latest versions of the available packages:

sudo apt update

If you wish to upgrade all packages (recommended for fresh installs) also run:

sudo apt upgrade

Ok, so now we can begin the actual installation for our NodeJS Environment:

sudo apt install npm
sudo npm cache clean -f
sudo npm install -g n

If there are no errors you can proceed to upgrading NodeJS to the latest version:

sudo n stable

OR install a specific version like so:

sudo n 4.4.6

Finally you must create a symlink for NodeJS:

ln -sf /usr/local/n/versions/node//bin/node /usr/bin/node

Now you should have both NodeJS and npm installed and ready to use. You can check your installed versions using:

node -v
npm -v

Footnote:
If you want your NodeJS apps to be able to listen on port 80, then you should execute:

apt install libcap2-bin

After the installation is done, run:

sudo setcap cap_net_bind_service=+ep `readlink -f `which node``

THAT’S IT!
Tags: nodejs,  tutorial,  Ubuntu 16.04 LTS

Written by Gabriel Moldoveanu

Related Posts
  • OpenSSH server – Enable and secure on Ubuntu 16.04 LTS

Leave a Reply

Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

← Google Straps Aclima Sensors To Street View Cars To Map Air Pollution
OpenSSH server – Enable and secure on Ubuntu 16.04 LTS →

Latest tweet

Invalid or expired token.

Recent Posts

  • The BMW MINI SP Daten v58 files
  • OpenSSH server – Enable and secure on Ubuntu 16.04 LTS
  • NodeJS install on Ubuntu 16.04 LTS (Xenial Xerus)
  • Google Straps Aclima Sensors To Street View Cars To Map Air Pollution
  • Why are smartwatches still a niche purchase?

VPS City Hosting

Address

Helsingborg, Skåne
Sweden

office@vps-city.com

https://www.vps-city.com

© Copyright - 2013-2017 : All Rights Reserved.
Powered by VPS City Hosting

Privacy Policy


Multi Domain SSLNetim Certified Partner

photo of




VPS City Hosting

office@vps-city.com

Videgatan

Helsingborg
,
Skane
,
25230

Sweden