React In The Cloud With Redhat

07 Aug 2024 - Omar N

This tutorial shows how to install and configure the JavaScript React library in Amazon Web Services (AWS) cloud using Red Hat Enterprise Linux 9.

Watch the video

Launch and EC2 instance with Red Hat

Select the following options when lunching an instance.

Connect to the EC2 Red Hat instance with SSH by using WinSCP

Update and Install Package Repositories

sudo dnf update
sudo dnf install zip
sudo dnf install unzip
# installs fnm (Fast Node Manager)
curl -fsSL https://fnm.vercel.app/install | bash

# activate fnm
source /home/ec2-user/.bashrc

# download and install Node.js
fnm use --install-if-missing 20

# verifies the right Node.js version is in the environment
node -v # should print `v20.16.0`

# verifies the right npm version is in the environment
npm -v # should print `10.8.1`

Launch React with Vite

npm create vite@latest
 cd "project name"
  npm install
  npm run dev -- --host

ViteReact