유쾌하지 못한 오류 기록

React 오류 기록 npm start와 yatn start가 안될 때

튼튼한간 2023. 1. 2. 09:10

React 오류 기록 npm start와 yarn start가 안될 때

 

➡ npm start 오류 내용

npm ERR! Missing script: "start"
npm ERR!
npm ERR! Did you mean one of these?
npm ERR!     npm star # Mark your favorite packages
npm ERR!     npm stars # View packages marked as favorites
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\admin\AppData\Local\npm-cache\_logs\2022-12-30T09_43_15_420Z-debug-0.log

 

 

➡ yarn start 오류 내용

yarn run v1.22.19
warning package.json: No license field
error Command "start" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

 

 

검색했을 때 나온 메인 문제 3가지

  • package.json 파일이 없거나 손상되었습니다.
  • package.json에 시작 스크립트가 정의되어 있지 않습니다.
  • 시작 스크립트는 패키지에 정의되어 있습니다. package.json파일이지만 올바른 스크립트가 아닙니다.

 

 

해결방법이라고 알려준 것들

➡ 안됨

 

 

package.json 파일의 "scripts"개체에 start 스크립트를 추가 하고 다시 npm start 해보기

➡ 원래 있었음 ㅠ_ㅠ

 

 

npm run start을 사용해보기

 

또 안됨..

 

npm install 한 후 다시 npm start 해보기

 

 

스타트 하는 경로가 잘못되어있었다..! 폴더 하나 더 들어가서 부르니까 됐음..!