Angular environment installation

Author: Dawid Adach

-

Goal

The goal of the following tutorial is to guide you on how to install all software required to start our journey with Angular. If have your environment ready, you can skip to next tutorial. However, if you never worked with Angular before this is a place to start at. Below steps will guide you on how to install all prerequisites regardless of platform (Windows, macOS, unix) you are using. Let's start!

1. Command line

Command line is a crucial for each developer. If you haven't used it before it's a high time to get familiar with it. It might look complicated and difficult to learn, however, once you put your hands on it you will find that is very powerful and useful tool.

How to run command line?

Keyboard shortcut:

On your keyboard press: + R . You will see Run windows. Type cmd and click OK or press Enter

Run window

You will see screen as below:

Windows command line

That's it. You can now use a command line, however, please keep in mind that Windows Command Line is frankly speaking - crappy tool. That's why we strongly encourage you to use some alternative like GitBash (installation guide here). It has more unix-like commands which are more user-friendly than built in windows commands.

How to run command line?

Keyboard shortcut:

Press cmd ⌘ + space to open Spotlight search, type terminal and hit Enter ⏎

Spotlight search

You will see screen as below:

macOS terminal

Unix unlike Windows or macOS, doesn't necessarily have Graphic User Interface (GUI), therefore in some distributions like RedHat, CentOS, Debian, Ubuntu Server terminal will launch immediately after booting machine.

In case you use some GUI, them may look differently, however in most cases you they will have Windows like "Start" button which will open search menu which allows you to find terminal app.

Sample start screen on Ubuntu:

Ubuntu Home

Also terminal windows and colors may vary depends on distribution, sample Ubuntu terminal:

Ubuntu terminal

Since you know how to run terminal, let's move to our runtime environment - Node.js.

2. Installing Node.js and Node Package Manager (npm)

  1. Download the Windows installer from the Nodes.js® web site.
  2. Run the installer (the .msi file you downloaded in the previous step.)
  3. Follow the prompts in the installer (Accept the license agreement, click the NEXT button a bunch of times and accept the default installation settings).
  4. Windows Node.js installation
  5. Restart your computer. You won’t be able to run Node.js® until you restart your computer.
  1. Download the Windows installer from the Nodes.js® web site.
  2. Run the installer (the .msi file you downloaded in the previous step.)
  3. Follow the prompts in the installer (Accept the license agreement, click the NEXT button a bunch of times and accept the default installation settings).
  4. macOS Node.js installation

Ubuntu/Debian

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

Red Hat® Enterprise Linux® / RHEL, CentOS and Fedora

curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
sudo yum -y install nodejs

Arch Linux

pacman -S nodejs npm

3. Verifying installation

It's time to check that we have Node and NPM installed correctly. We will simply run few commands to see what version of each is installed and to run a simple test program:

  1. Test Node: Open command line and type:
    node -v
    
    This should print a version number, so you’ll see something like this:
    v8.9.1
    
  2. Test npm: To see if NPM is installed, type:
    npm -v
    
    This should print NPM’s version number so you’ll see something like this:
    5.5.1
    
  3. Verify JS: Create a file called hello.js and type inside:
    console.log("Hello world from MDB");

    Open terminal, navigate to folder where you have created a file and type

    node hello.js
    you should see following output:

hello world

Now let's get back to our current project.Click NEXT LESSON button to proceed further.


Next lesson

Spread the word:
Do you need help?: Use our support forum

About author

Dawid Adach
For more than 5 years Dawid was working as an IT Consultant specializing in SOA/EAI/ESB for banking domain. He was gaining experience working in countries like Netherlands, Belgium, Poland and India developing enterprise-class systems for the biggest companies within a domain. Since 2 years as a co-founder of mdbootstrap.com & brandflow.net is using and teaching others technologies like Angular, TypeScript, PHP, AJAX, Mongo, SQL, Hadoop Stack, Virtualization, Automation and many others...