firebase init command with error message (Cannot read Property 'projectId' of Undefined)

Asked

Viewed 131 times

0

I’m trying to use Firebase CLI Tools to create a website hosting service, but it’s returning an error message:

Typeerror: Cannot read Property 'projectId' of Undefined

Follow the details:

Operating System:
Windows 10

Executed command:

firebase init --debug

Expected return:
Create configuration files firebase.json at the root of the project.

Result obtained:

You're about to initialize a Firebase project in this directory:
D:\projetos\portfolio_project\jobs\templates

[info]
=== Project Setup
[info]
[info] First, let's associate this project directory with a Firebase project.
[info] You can create multiple project aliases by running firebase use --add,
[info] but for now we'll just set up a default project.
[info]
[debug] [2018-10-18T15:03:51.589Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects?page_size=100

[debug] [2018-10-18T15:03:53.158Z] <<< HTTP RESPONSE 200
[debug] [2018-10-18T15:03:53.795Z] TypeError: Cannot read property 'projectId' of undefined
at C:\Users\adrie\AppData\Roaming\npm\node_modules\firebase-tools\lib\init\features\project.js:48:23
at arrayMap (C:\Users\adrie\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\lodash\lodash.js:639:23)
at Function.map (C:\Users\adrie\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\lodash\lodash.js:9556:14)
at C:\Users\adrie\AppData\Roaming\npm\node_modules\firebase-tools\lib\init\features\project.js:46:21
at process._tickCallback (internal/process/next_tick.js:68:7)
[error]
[error] Error: An unexpected error has occurred.

1 answer

0

A warning for who has 2 or more google accounts, when accessing firebase cli and trying to access a project, make sure that q the account used in the cli has a firebase project created.

That was the problem. With 2 or more google accounts, and trying to access through the cli account q does not have firebase project invariably does not work!

For this reason I could not find the 'projectId', I had no project!!

It’s just a lapse of attention, but it stops you for a while!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.