Setup React Development Environment on CentOS/Fedora/Red Hat

Exported on 30-Aug-2021 15:08:35

Parameters

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

1 - Update apt repositories

Update apt packages

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
# Install APT update
sudo yum -y update

2 - Install Node & NPM

This installs NodeJS server into the target machine

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
# 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

3 - Create React App

Creates a basic react application

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
# Scaffold a react project
npx create-react-app myfirstreactapp

4 - Start React Development Server

Starts the react development server in background.

To access the running server process, use the command: 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 working directory
cd myfirstreactapp

# Install screen package
sudo yum -y install screen

# Configure screen to run in background
sudo echo "zombie xy" >> ~/.screenrc

# Start development server
screen -d -m npm start