問題点
Git Bashからfirebase login
しようとすると、以下のようなエラーが出力される。
$ firebase login
Error: Cannot run login in non-interactive mode. See login:ci to generate a token for use in non-interactive environments.
非インタラクティブモードではlogin
コマンドが実行できないっぽい。
対処法
login
コマンドの後ろに--interactive
をつけて以下のようにする。
$ firebase login --interactive
これでうまくいく。
ちなみに、ホスティングを中止するためにhosting:disable
コマンドを実行するときも同様で、
$ firebase hosting:disable
Error: Missing required options (confirm) while running in non-interactive mode:
- confirm Are you sure you want to disable Firebase Hosting?
This will immediately make your site inaccessible!
上記のようなエラーが出る場合は
$ firebase hosting:disable --interactive
とする。
余談
firebaseの設定で以下のように選択する箇所がある。
Which Firebase CLI features do you want to setup for this folder? Press Space to select features, then Enter to confirm your choices. (Press <space> to select)
>( ) Database: Deploy Firebase Realtime Database Rules
( ) Firestore: Deploy rules and create indexes for Firestore
( ) Functions: Configure and deploy Cloud Functions
( ) Hosting: Configure and deploy Firebase Hosting si
( ) Storage: Deploy Cloud Storage security rules
Git Bashだからなのかはわからないが、書いてある通りスペースを押しても選択できない。
そういう時は、数字で選択するといいっぽい。
例えば、Hosting
を選択したいときは、4
を入力する。
この方法だと直感的じゃなくて分かりにくいので、他の良い方法を教えてほしい...