728x90

🌭 해결 방법
먼저 터미널에 npm inint을 입력하면 package.json파일 만드는 과정이 나온다.
적절한 옵션을 선택 및 기입하고 Enter하고 넘어 갑니다! 그런 다음 package.json 파일에 들어갑니다!
//package.json
{
"name": "react-study",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "react-scripts start" // 여기부분!!!
},
"author": "",
"license": "ISC",
"description": ""
}
package.json 파일의 "scripts"개체에 start 스크립트를 추가 하고 다시 npm start를 하면 해결!!
🥓 정리
- npm err! missing script: start 에러가 뜨면 script 개체에 start 스크립트가 없다!!
- 터미널 창에 npm init을치고 package.json파일 기본 설정다하고 엔터!!
- 새로 만든 package.json파일에서 "scripts"개체에 start 스크립트를 추가 하기
- 저장 후 다시 터미널 창에 npm start
728x90
'개발&etc > React' 카테고리의 다른 글
[React] 에러: Cannot find module 'react' (0) | 2023.03.24 |
---|---|
[React] node 버전 다운 그레이드 하기 (0) | 2023.03.24 |
[React]에러: react_dom_client__WEBPACK_IMPORTED_MODULE_1__.render is not a function show in the console of localhost:3000 (0) | 2023.03.24 |
[React] 'Axios' is not defined (1) | 2023.03.16 |
[React] Failed to compile. Module not found: Can't resolve 'react-router-dom' (0) | 2023.03.16 |