Skip to content

Setup Environment For Angular App

Lakshman.S edited this page Sep 12, 2020 · 1 revision

Hi Friends, This is Lakshman here.

Let's take out the first step against "Angular Best Practices".

As Initial, we will discuss the best option to "Setup Environment For Angular App Development".

Currently, there are various ways to Setup Dev-Environment for different platforms. On this, we will set up for the Windows Platform.

In Windows:

We do hick of mistakes on installing angular dependencies by Manual in Windows.

Node.JS

  • Usually, we download the Current Version instead of the LTS Version because we want to work on the latest technologies
  • "That First Issue." because each angular application has its node-sass dependencies for SCSS Files which supported by the LTS version, but not in the Current Version.

Point: Always Use LTS Version of Node.JS

Angular CLI

  • Always install the Angular CLI If you are required to create a new Angular Project.
  • The reason behind is every existing angular project consist of Angular-CLI inside Dev Dependencies. So we can use Npm Script to Serve, Build, Test, etc.,

Once Node.JS and Angular CLI Installation is Done. We will create a new Angular Project in the Windows.

Let see the Pros & Cons in Windows Development.

Pros:

  • Able to Setup Environment by yourself gives knowledge on the installation procedure.
  • Developing Local & Can able to Test on Mobile if its a PWA based application.

Cons

  • If, Installed Node.JS not supported for that version of the angular project.

In Windows WSL:

With the latest innovations as WSL, we can even set up in WSL Environment.

But its Process is pretty similar to Windows Installation.

  • Node.JS
  • Angular CLI.

Let see the Pros & Cons in Windows WSL Development.

Pros:

  • Able to explore Linux OS.
  • I will have a separate environment where your system doesn't need any installation.
  • Once complete, we can commit files then delete the WSL.

Cons:

  • You have to initialize multiple WSL for each Angular App if Node.JS version not supported.
  • Can't able to Test on Mobile if its a PWA based application.

In Docker Container:

With the evolving platform as Docker, we can even set up our Environment using it.

As primary, you need to follow anyone option from below:

  1. In Windows.
  2. In Windows WSL.

To create an Angular project, we required Node.JS and Angular CLI.

Once we created an Angular project, we can configure to run it as a container in Docker.

My Preferred is In Windows WSL because once, we set up in Docker we can revoke the Installation of WSL Distro and Run Angular App in Window with Docker.

Pros:

  • Environment Isolation.
  • Easy for Build, Package & Deploy.
  • Can Updated Docker File if App Upgrade.

Cons:

  • It's required to build a docker image per environment for an Angular application.

On-road head, we will discuss a lot of things.

Looking forward to your comments and share your feedback.

Until that, I am Lakshman, Signing Off.