1

I'm trying to setup a completely new project in a new folder in Mac OS by running:

firebase init

And I always get the same error:

Error: Server Error. certificate has expired

I tried different things as mentioned in related question like:

npm i -g firebase-tools@latest
sudo npm i -g firebase-tools@latest
npm install --save firebase

Nothing helped. Sharing firebase-debug.log below:

[debug] [2020-02-02T21:27:36.490Z] ----------------------------------------------------------------------
[debug] [2020-02-02T21:27:36.493Z] Command:       /usr/local/bin/node /usr/local/bin/firebase init hosting
[debug] [2020-02-02T21:27:36.493Z] CLI Version:   3.18.5
[debug] [2020-02-02T21:27:36.493Z] Platform:      darwin
[debug] [2020-02-02T21:27:36.493Z] Node Version:  v10.16.0
[debug] [2020-02-02T21:27:36.500Z] Time:          Sun Feb 02 2020 22:27:36 GMT+0100 (Central European Standard Time)
[debug] [2020-02-02T21:27:36.500Z] ----------------------------------------------------------------------
[debug] 
[debug] [2020-02-02T21:27:36.511Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase"]
[debug] [2020-02-02T21:27:36.512Z] > authorizing via signed-in user
[info] 
                      
                                               
                      
                                               
                               

You're about to initialize a Firebase project in this directory:

  /Users/user/apps/laisvi

[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] [2020-02-02T21:27:36.519Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects  

 Sun Feb 02 2020 22:27:36 GMT+0100 (Central European Standard Time)
[debug] [2020-02-02T21:27:37.059Z] Error: certificate has expired
    at TLSSocket.onConnectSecure (_tls_wrap.js:1055:34)
    at TLSSocket.emit (events.js:198:13)
    at TLSSocket.EventEmitter.emit (domain.js:448:20)
    at TLSSocket._finishInit (_tls_wrap.js:633:8)
[error] 
[error] Error: Server Error. certificate has expired

I think it's a different problem, maybe related with rights on Linux? Anyone facing the same issue?

Lukas
  • 610
  • 7
  • 16

1 Answers1

3

FOUND THE RESOLUTION!

The problem was that I installed firebase using old documentation and it was linked to firebase command ignoring the firebase-tools which didn't get any alias by default. My steps:

Step 1: Locate firebase:

which firebase

Step 2: Delete firebase

rm // whatever location it gave you which firebase

Step 3: Install again firebase-tools (might not have been necesary)

npm i -g firebase-tools@latest

Step 4: Create an alias to the tools

alias firebase="`npm config get prefix`/bin/firebase"

You can now do firebase init and finally create a firebase project with vanilla Js!

Lukas
  • 610
  • 7
  • 16