ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Metro Unexpected Token
    React Native (리액트 네이티브) 2022. 5. 9. 14:23

    Node 버전 : 16.15.0

    react-native-cli 버전 : 2.0.1

    react-native 버전 : 0.68.1

     

    현상 : react-native run-ios 로 빌드시 Metro 모듈에서 Unexpected Token 에러

     

    해결 방법 :

     

    1. 기존 node.js 버전 전부 제거

     

    nvm ls 로 버전 기존 버전 확인

    (버전명은 상황에 따라 변경)

    nvm uninstall v10.15.1

     

    2. 케시 제거

    nvm cache clear

     

    3. node.js 설치

    nvm install v16.15.0

     

    4. react-native-cli 제거/설치

    제거 : npm uninstall -g react-native-cli

    확인 : react-native

    설치 : npm install -g react-native-cli

    확인 : react-native

     

    5. react-native 프로젝트 생성

    ("reactApp" 은 프로젝트명 각자 상황에 따라 변경)

    react-native init reactApp

    댓글

Designed by Tistory.