Setup AngularJS Development Environment On CentOS/Fedora/Red Hat

Exported on 30-Aug-2021 16:40:38

Installs and configure AngularJS on Red Hat based Linux distributions

Parameters

Name Type Script Reference Default Value Comment
s1 Linux / Unix Server s1
s1c Linux OS Credential s1c

1 - Install Node.js and NPM

Installs NodeJS and npm

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# update yum repository
sudo yum -y update

# Download setup script
sudo curl -fsSL https://rpm.nodesource.com/setup_12.x -o nodesource.sh

# Configure install script
sudo bash nodesource.sh

# Start installation 
sudo yum install -y nodejs

2 - Setup Angular Project

Installs angular cli and creates a new Angular project

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Install angular and angular-cli
sudo npm i -g @angular/cli

# Create new project 
echo "y" | ng new angular-project --style css

3 - Install screen package

Installs screen package, used to keep the development server running in background

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Install screen
sudo yum -y install screen

# Configure zombie mode
sudo echo "zombie xy" >> ~/.screenrc

4 - Start Angular Development Server

Starts Angular development server on http://YOUR_IP:4200,

To access the server process run: screen -x

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Change directory
cd angular-project

# Start dev server
screen -m -d ng serve --host 0.0.0.0