! [remote rejected] master -> master (pre-receive hook declined)에러 해결 방법

Syd·2022년 9월 1일
0

에러노트

목록 보기
4/4

heroku 배포 마지막 단계(heroku 프로젝트 생성)에서

heroku create <프로젝트명>
heroku config:set NPM_CONFIG_PRODUCTION=false 

까지는 잘 됐는데

git push heroku master

여기서부터

! [remote rejected] master -> master (pre-receive hook declined)

라는 위와 같은 에러 메세지가 뜨면서 push에 실패했다.


구글링 결과

1) 'package-lock.json' 또는 'yarn.lock'을 삭제
2) git subtree 사용

이 두 가지 방법을 확인 할 수 있었는데 1번 방법만 실행했을때는 여전히 실패했지만, package-lock.json 과 yarn.lock 둘 다 삭제하고 2번 방법을 시도하니 결국 성공했다.

line 382 까지는 실패한 명령어고, line 383-385/391 이 성공한 명령어다.

git subtree add --prefix [폴더이롬]
git add .
git commit -m "msg"
git push heroku master

위와 같은 순서대로 하면 성공!

  • tip
    종료한 터미널의 기록을 보고싶으면 history를 입력하면 된다!

참고

profile
Slow and steady wins the race 🐢

0개의 댓글