커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
실수로 package.json 건드려서 에러 뜨네요
앱개발 종합반 - 리액트 네이티브
2주차
북마크
김*혁
댓글
4
추천
0
조회수
14
조회수
14
답변 완료

{

  "name": "sparta-myhoneytip-th",

  "version": "1.0.0",

  "main": "node_modules/expo/AppEntry.js",

  "scripts": {

    "start": "expo start",

    "android": "expo start --android",

    "ios": "expo start --ios",

    "web": "expo start --web",

    "eject": "expo eject"

  },

  "dependencies": {

    "expo": "~41.0.1",

    "expo-status-bar": "~1.3.0",

    "react": "17.0.2",

    "react-dom": "17.0.2",

    "react-native": "0.68.2",

    "react-native-web": "0.17.7"

  },

  "devDependencies": {

    "@babel/core": "^7.12.9"

  },

  "private": true

}


지금 package.json 코드고


import React from 'react';

import { StyleSheet, Text, View } from 'react-native';


export default function App() {

  return (

    <View style={styles.container}>

      <View style={styles.containerOne}>


      </View>

      <View style={styles.containerTwo}>


      </View>

    </View>

  );

}


const styles = StyleSheet.create({

  container: {

    flex:1

  },

  containerOne: {

    flex:1,

    backgroundColor:"red"

  },

  containerTwo:{

    flex:2,

    backgroundColor:"yellow"

  }

});


app.js 코드 입니다



Error parsing JSON: import React from 'react';

import { StyleSheet, Text, View } from 'react-native';


export default function App() {

 return (

  <View style={styles.container}>

   <View style={styles.containerOne}>


   </View>

   <View style={styles.containerTwo}>


   </View>

  </View>

 );

}


const styles = StyleSheet.create({

 container: {

  flex:1

 },

 containerOne: {

  flex:1,

  backgroundColor:"red"

 },

 containerTwo:{

  flex:2,

  backgroundColor:"yellow"

 }

});


├─ File: C:\Users\kth06\OneDrive\바탕 화면\sparta study\sparta-myhoneytip-th\package.json

└─ Cause: SyntaxError: Unexpected token i in JSON at position 0

> 1 | import React from 'react';

  | ^

 2 | import { StyleSheet, Text, View } from 'react-native';  

 3 |

 4 | export default function App() {


에러 코드 입니다!

취소
 공유
취소
댓글 0
댓글 알림
나의얼굴