ExpressJS Series: Setting up a NodeJS on your machine

Ganesh B
3 min readOct 1, 2018

--

ExpressJS is a minimalistic framework and is now a part of Node.js foundation. It helps you set up a NodeJS application and server within minutes without a lot of learning curve. It can be as secure as you make it, quite performant and scalable, and more there are a lot of packages you can leverage to get a enterprise level application up and running.

ExpressJS is very well documented, has a big community around it, lots of resources in the internet to get started, and good number/variety of use case questions answered in stackoverflow. However, I did not see any resource that covers all major sections and nuances of the Expressjs application development in one place. I, hopefully, intend to cover sections of basic application planning, basic architecture, setup, development, packages and management, testing, deployment, and some related devops in the coming days.

NODEJS INSTALLATION:

Lets get started with installing NodeJS to get the ExpressJS project set up for development. To work with and create a ExpressJS server you need to have NodeJS installed on your machine. If you have not done so, please go ahead and install NodeJS on your system. The binaries for most operating system (OS), i.e., Windows, Mac, Linux, and others are available in the download section of the website. I use the current version of NodeJS on my machine but you can install the LTS (long term support) version on your machine in case you need a stable supported version of NodeJS.

OS INSTALLERS:

NodeJS binaries for Windows and Mac are actually installers. You can use them for installation of the environment in your system. Trust me, I have not seen a cleaner installation process using the installer for the operating systems anywhere. Just follow the installer instructions. It can be as simple as clicking next > next > finish. The installers/binaries set up both the environment and the package manager to get you start working with NodeJS.

BUILDING FROM SOURCE for supported OS’s:

Note: If your NodeJS does not have binaries for your operating system then get the source, and build the NodeJS binary for your OS. You can head to the NodeJS Github Repository here for the getting the documentation of installing NodeJS from source for supported operating systems.

INSTALLING WITH OS PACKAGE MANAGERS:

Note: For many OS’s, you can install NodeJS using their OS package managers. You can find the details of installation here.

CONFIRM INSTALLATION:

Once you have installed NodeJS on you system please do not forget to run these commands on your shell to confirm installation. If these two commands dont work then you possibly did not success installation and you might have to repeat the steps again!

node -v

npm -v

The above two commands will print the installed version for your NodeJS environment and package manager.

This is how it looks on my system.

Checking NodeJS Environment command line executable (node) and Package Manager (NPM) is set up right

Thats it. You are ready to get an NodeJS application up and running on your system.

In the next few blogs, we will create a simple ExpressJS server and then get into a lots of details of some important sections. I am assuming you understand some basics of Javascript. If you do not then please head to Mozilla documentation to understand, atleast, declaring variables, primitive data types, arrays and basic manipulation, objects and basic working/manipulation, functions; and ,if possible, scopes/closures in Javascript.

In the next blog, we will create/set up a Simple ExpressJS project.

Setting up a Basic ExpressJS Server: https://medium.com/@ganeshsurfs/expressjs-series-setting-up-a-basic-expressjs-server-3ad47264cff3

ExpressJS Series - All Blogs https://medium.com/@ganeshsurfs/expressjs-series-links-9e038be8d78b

Let me know how I did, and if you learnt something new. Do leave your comments, and dont forget to like the article.

--

--