« Firebase Authentication | メイン | Firebase Realtime Database »

javascript

Google Cloud Shell で firebase init エラー

Realtime Database を使う Firebaseプロジェクトで、これまでのように Google Cloud Shell
$ firebase init
したところエラー。
$ npm -v
9.8.1

$ firebase --version
12.4.6
...▼
:
=== Project Setup

First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add, 
but for now we'll just set up a default project.

? Please select an option: Use an existing project
? Select a default Firebase project for this directory: try1-e3fc7 (try1)
i  Using project try1-e3fc7 (try1)

=== Database Setup
i  database: ensuring required API firebasedatabase.googleapis.com is enabled...
✔  database: required API firebasedatabase.googleapis.com is enabled


Error: Failed to get instance details for instance: try1-e3fc7-default-rtdb. See firebase-debug.log for more details.
[firebase-debug.log]を見ると
:
=== Project Setup
:
=== Database Setup
:
[debug] [2022-08-15T01:34:58.344Z] HTTP Error: 403, Your application is authenticating by using local Application Default Credentials. The firebasedatabase.googleapis.com API requires a quota project, which is not set by default. To learn how to set your quota project, see https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds .
[debug] [2022-08-15T01:34:58.345Z] FirebaseError: HTTP Error: 403, Your application is authenticating by using local Application Default Credentials. The firebasedatabase.googleapis.com API requires a quota project, which is not set by default. To learn how to set your quota project, see https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds .
    at responseToError (/usr/local/nvm/versions/node/v18.12.1/lib/node_modules/firebase-tools/lib/responseToError.js:49:12)
    at RetryOperation._fn (/usr/local/nvm/versions/node/v18.12.1/lib/node_modules/firebase-tools/lib/apiv2.js:285:77)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
で停止。Windows11にインストールしたFirebaseコマンドでは正常なので環境の問題。 [firebase-debug.log]に示されるURL
https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds
を参照すると認証が関係している模様。
firebase login
すると認証ページがローカルホストにつながろうとして行方不明に。https://qiita.com/Yatima/items/f550951ceb830f934dfd によれば、
firebase login --no-localhost
で改善。
Realtime Database の初期化も解決。

トラックバック

このエントリーのトラックバックURL:
https://www.remix.asia/cgi/mt/mt-tb.cgi/7758

コメントを投稿

(いままで、ここでコメントしたことがないときは、コメントを表示する前にこのブログのオーナーの承認が必要になることがあります。承認されるまではコメントは表示されません。そのときはしばらく待ってください。)