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를 설치하니까 오류가 사라지고 설치가 되었다!