Setup AngularJS Development Environment on Ubuntu/Debian

Exported on 30-Aug-2021 16:27:30

Install and configure AngularJS Development Environment

Parameters

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

1 - Install NodeJS and NPM

Installs NodeJS v16 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
# Refresh repositories
sudo apt update


# Add nodejs 16 ppa (personal package archive) from nodesource
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -

# Install nodejs and npm
sudo apt-get install -y nodejs

2 - Setup 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 and configure screen

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 apt -y install screen

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

4 - Start 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