使用"firebase init"在本地启动新项目可以带来"Server Error. certificate has expired"



我正在尝试通过运行以下命令在Mac OS的新文件夹中设置一个全新的项目:

firebase init

而且我总是收到同样的错误:

错误

:服务器错误。 证书已过期

我尝试了相关问题中提到的不同事情,例如:

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

没有任何帮助。共享Firebase-debug.log如下所示:

[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

我认为这是一个不同的问题,可能与 Linux 上的权利有关?有人面临同样的问题吗?

找到了分辨率!

问题是我使用旧文档安装了 firebase,它链接到firebase命令,忽略默认情况下没有任何别名的firebase-tools。我的步骤:

第 1 步:定位火力基地:

which firebase

第 2 步:删除火力基地

rm // whatever location it gave you which firebase

第 3 步:重新安装Firebase 工具(可能不是必需的(

npm i -g firebase-tools@latest

步骤 4:创建工具的别名

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

您现在可以执行firebase init,并最终使用vanilla Js创建一个Firebase项目!

最新更新