Angular environment installation

Author: Dawid Adach

-

Goal

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

1. Command line

The command line is crucial for every developer. If you haven't used it before then it's 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 a very powerful and useful tool.

How to run the 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 a screen like that 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 the command line?

Keyboard shortcut:

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

Spotlight search

You will see a screen like that below:

macOS terminal

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

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

Sample start screen on Ubuntu:

Ubuntu Home

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

Ubuntu terminal

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

2. Installing Node.js and the 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 then 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 MacOs installer from the Nodes.js® web site.
  2. Run the installer (the .pkg 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 then 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 the 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 the 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 should 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 the folder where you have created a file and type

    node hello.js
    you should see the following output:

hello world

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


Previous lesson Next lesson

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

About the author

Dawid Adach
For more than 5 years Dawid worked as an IT Consultant specializing in SOA/EAI/ESB in the banking domain. He gained experience working in countries like Netherlands, Belgium, Poland and India developing enterprise-class systems for the most prestigious companies. Since co-founding mdbootstrap.com & brandflow.net in 2016 he has been using and teaching technologies such as Angular, TypeScript, PHP, AJAX, Mongo, SQL, Hadoop Stack, Virtualization, Automation and many others...