Firebase init command with error message (Can not read property 'projectId' of undefined)

0

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

  

TypeError: Can not read property 'projectId' of undefined

Here are the details:

Operating System:
Windows 10

Run command:

firebase init --debug

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

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.
    
asked by anonymous 18.10.2018 / 20:13

1 answer

0

An alert for those who have 2 or more accounts on google , when accessing the firebase cli and trying to access a project, make sure 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 the account does not have firebase project invariably does not work!

For this reason I could not find the 'projectId', I did not have any project !!

It's just a lapse of attention, but it hangs up for a while !!

    
18.10.2018 / 21:49