エラー内容
Reactの勉強のためこちらの教材でアプリを作成後、Github Pagesにデプロイする箇所で以下のエラーが発生した。
$ gh-pages -d build
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).
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
環境
macOS Monterey 12.3.1
react@18.1.0
yarn 1.22.17
原因
Githubリポジトリが登録されていなかった。
対処方法
Githubでリポジトリ作成
→ ターミナルでgit remote add origin <リポジトリのURL>を入力
→ 再デプロイyarn run deploy
→ 無事にデプロイ出来ました。
参考