> For the complete documentation index, see [llms.txt](https://help.goorm.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.goorm.io/ko/goormide/07.-faq/react-native.md).

# React Native 컨테이너가 실행이 안 돼요

아래 순서대로 터미널에 입력해주세요.

### 노드 버전 업

```sh
rm -rf /usr/lib/node_modules
rm -rf /usr/bin/node
rm -rf /usr/include/node
rm -rf /usr/local/bin/node
rm -rf /usr/local/include/node
rm -rf /usr/share/man/man1/node*
rm -rf /usr/local/lib/node_modules/
rm -rf /usr/local/bin/npm
rm -rf ~/.npm
rm -rf ~/.node-gyp
apt remove nodejs -y

curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs

```

### 터미널 새로고침

<figure><img src="https://2181851870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lq-Q9LciN1X9EABxGkt%2Fuploads%2FCECpic5v6aTowmjbxngF%2F%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202023-04-14%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%202.02.15.png?alt=media&amp;token=6c57be8c-6aed-4490-8c3a-17cca8e3448e" alt=""><figcaption></figcaption></figure>

터미널 옆 새로고침 버튼을 눌러 터미널을 새로고침합니다.

### package.json 파일 수정

`{{이곳에 PORT 번호를 넣어주세요}}` 부분을 **상단 메뉴 \[컨테이너]** → **\[포트포워딩 설정]의 내부 포트 19000에 해당하는 외부 포트의 값**으로 수정합니다.

```json
{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start --port {{이곳에 PORT 번호를 넣어주세요}}",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "expo": "~48.0.10",
    "expo-status-bar": "~1.4.4",
    "react": "18.2.0",
    "react-native": "0.71.6",
    "react-native-web": "~0.18.10",
    "react-dom": "18.2.0",
    "@expo/webpack-config": "^18.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0"
  },
  "private": true
}

```

### node\_modules 설치

```sh
npm i

npx expo install react-native-web@~0.18.10 react-dom@18.2.0 @expo/webpack-config@^18.0.1

```

### React Native 기본 명령어로 실행

<figure><img src="https://2181851870-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lq-Q9LciN1X9EABxGkt%2Fuploads%2FQp2VVij6kGRYeQ5mxkEH%2F%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202023-04-14%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%202.03.03.png?alt=media&amp;token=6ac114ea-d7d7-41a6-a1ef-800ef1869134" alt=""><figcaption></figcaption></figure>

우측 상단의 실행 버튼을 눌러 실행합니다.
