AWS] EC2에 React.js 배포하기

김무준·2022년 6월 24일
0

앞선 글에서 Windows 환경에서 EC2 instance로 접속하였다.
대상 프로젝트: https://github.com/saleel/react-native-super-grid

1. EC2 instance type: Ubuntu Server 20.04

  1. check if git is installed
# Ubuntu server의 경우 git이 미리 설치되어 있었다
git version
  1. clone the target project
git clone https://github.com/saleel/react-native-super-grid.git
  1. Install node.js
    stackoverflow
    해당 링크 첫 번째 댓글 참고해서 node.js 설치함

이후 react 설치 과정에서 npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap 해당 오류가 발생함.
https://exerror.com/npm-warn-deprecated-tar2-2-2-this-version-of-tar-is-no-longer-supported-and-will-not-receive-security-updates-please-upgrade-asap/ 링크에서 Solution 2를 통해 정상적으로 설치함(Solution 1은 작동하지 않았음)


2. EC2 instance type: Amazon Linux 2 AMI

  1. Install git in the EC2 instance
# Perform a quick update on EC2 instance
sudo yum update -y

# Install git in EC2 instance
sudo yum install git -y

# Check the git version 
git version
  1. Clone the target project
git clone https://github.com/saleel/react-native-super-grid.git

하지만 여기서 아래와 같은 오류가 발생함: 해결하지 못하였음
"fatal: could not create work tree dir 'dir name': Permission denied"

  1. install Node.js in EC2

    reference link: aws document

하지만 설치 도중 아래와 같은 오류가 발생함.

node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)

https://exerror.com/node-lib64-libm-so-6-version-glibc_2-27-not-found-required-by-node/ 해당 링크를 참고해서,

nvm install 16

# 이후 아래 명령어를 통해 node.js 정상 설치 확인함
node -v

0개의 댓글