react で作ったアプリを firebase へデプロイ(パスのつなぎ方)

firebase

npm i -g firebase-tools

command not found: firebaseがでたらパスをつなぐために、export PATH=$PATH:npm bin -gを入力する。

firebase login

firebase init

何がしたいのか聞かれるので、やりたいことを選ぶ。今回はHostingを選択。

「矢印キー」で移動して、「スペース」で選択し、「enter」で決定。

Please select an option?

今回は、Use an existing project(すでにあるプロジェクト)

ディレクトリが合っていることを確認してenter

What do you want to use as your public directory?

これは、publicではなくbuildにする。

Configure as a single-page app?

こちらは、Nを選択する。

npm run build

firebase deploy

タイトルとURLをコピーしました