react tailwind 설치관련 블로그를 보고
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
이부분을
{
// ...
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "react-scripts eject"
},
}
이렇게하라고 나와있어서 이렇게 바꾸고 craco를 설치하니까
$ npm install @craco/craco
npm ERR! code EJSONPARSE
npm ERR! path C:\프로젝트경로/package.json
npm ERR! JSON.parse Unexpected token "/" (0x2F) in JSON at position 숫자 while parsing near "...ripts eject\"\n },\n // \"scripts\": {\n //..."
npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\~~\AppData\Local\npm-cache\_logs\2022-12-06T08_~_~_~~Z-debug-0.log
이런식으로 오류가 나왔었다.
그래서 맨처음상태로 package.json 코드를 밑과같이 바꾸고
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
craco를 설치하니까 오류가 사라지고 설치가 되었다!
'Front-End > React' 카테고리의 다른 글
React css 깨짐현상 해결방법(bootstrap css 로 인한 전체 css 깨짐문제) (0) | 2022.12.09 |
---|---|
React 프로젝트 디렉토리 구조 (tailwind css 설치시) (0) | 2022.12.07 |
React - 상위 컴포넌트 , 하위 컴포넌트 [프로퍼티(props)] (0) | 2022.12.04 |
React 데이터 흐름 (0) | 2022.12.04 |
React 에서 { } 를 쓰는이유? (0) | 2022.12.03 |