LoginSignup
35
14

More than 5 years have passed since last update.

Git Bashでfirebase loginする

Last updated at Posted at 2018-03-06

問題点

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を入力する。

この方法だと直感的じゃなくて分かりにくいので、他の良い方法を教えてほしい...

35
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
35
14