[오류해결] Error: Failed to get remote.origin.url (task must either be run in a git repository with a configured origin remote or must be configured with the "repo" option).

Yeara Choi·2024년 1월 25일

git, GitHub

목록 보기
2/2
post-thumbnail

npm run deploy

"deploy": "gh-pages -d build",
"predeploy": "npm run build"

package.json내의 scripts에 git 페이지를 빌드하기 위한 코드를 넣고,
터미널에 npm run deploy를 입력했을 때 발생한 에러이다.

오류 메세지를 보면 origin 경로를 가져오는데 실패했다고 한다.

해결 방법

  1. git remote -v 현재 깃허브 경로를 확인하고 복사한다
  2. git remote add origin https://github.com/(이름)/(리포지터리)
  3. git push -u origin master
  4. npm run deploy 재실행하고 배포 확인

0개의 댓글