Error: Failed to make request to https://www.gstatic.com/firebasejs/releases.json firebase init error
Error: Failed to make request to https://www.gstatic.com/firebasejs/releases.json firebase init error
我正在尝试在 firebase 上托管一个反应网站(使用 npx create-react-app 创建),在我 运行 firebase init 命令登录后它给出了一个错误,完整的日志:
> ? Are you ready to proceed? Yes ? Which Firebase features do you want
> to set up for this directory? Press Space to select features, then
> Enter ? Which Firebase features do you want to set up for this
> directory? Press Space to select features, then Enter ? Which
> Firebase features do you want to set up for this directory? Press
> Space to select features, then Enter ? Which Firebase features do you
> want to set up for this directory? Press Space to select features,
> then Enter ? Which Firebase features do you want to set up for this
> directory? Press Space to select features, then Enter ? Which Firebase
> features do you want to set up for this directory? Press Space to
> select features, then Enter to confirm your choices. Hosting:
> Configure files for Firebase Hosting and (optionally) set up GitHub
> Action de ploys
>
> === 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: genxclub-55b73 (genxclub) i
> Using project genxclub-55b73 (genxclub)
>
> === Hosting Setup
>
> Your public directory is the folder (relative to your project
> directory) that will contain Hosting assets to be uploaded with
> firebase deploy. If you have a build process for your assets, use your
> build's output directory.
>
> ? What do you want to use as your public directory? build ? Configure
> as a single-page app (rewrite all urls to /index.html)? Yes ? Set up
> automatic builds and deploys with GitHub? No
>
> Error: Failed to make request to
> https://www.gstatic.com/firebasejs/releases.json
我也试过做 firebase init --debug,它给了我这个错误:
[2021-08-20T07:48:26.003Z] >>> [apiv2][query] GET https://www.gstatic.com/firebasejs/releases.json [none]
[2021-08-20T07:48:26.810Z] FetchError: request to https://www.gstatic.com/firebasejs/releases.json failed, reason: unable to get local issuer certificate
at ClientRequest.<anonymous> (C:\Users\Swapnil\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-fetch\lib\index.js:1461:11)
at ClientRequest.emit (events.js:400:28)
at ClientRequest.emit (domain.js:470:12)
at TLSSocket.socketErrorListener (_http_client.js:475:9)
at TLSSocket.emit (events.js:400:28)
at TLSSocket.emit (domain.js:470:12)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Error: Failed to make request to https://www.gstatic.com/firebasejs/releases.json
我也尝试过 npm audit 和 npm audit --force,但没有用
我的文件:
节点不允许我在未授权时使用互联网
我使用 运行 这个命令解决了错误:
set NODE_TLS_REJECT_UNAUTHORIZED=0
我正在尝试在 firebase 上托管一个反应网站(使用 npx create-react-app 创建),在我 运行 firebase init 命令登录后它给出了一个错误,完整的日志:
> ? Are you ready to proceed? Yes ? Which Firebase features do you want > to set up for this directory? Press Space to select features, then > Enter ? Which Firebase features do you want to set up for this > directory? Press Space to select features, then Enter ? Which > Firebase features do you want to set up for this directory? Press > Space to select features, then Enter ? Which Firebase features do you > want to set up for this directory? Press Space to select features, > then Enter ? Which Firebase features do you want to set up for this > directory? Press Space to select features, then Enter ? Which Firebase > features do you want to set up for this directory? Press Space to > select features, then Enter to confirm your choices. Hosting: > Configure files for Firebase Hosting and (optionally) set up GitHub > Action de ploys > > === 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: genxclub-55b73 (genxclub) i > Using project genxclub-55b73 (genxclub) > > === Hosting Setup > > Your public directory is the folder (relative to your project > directory) that will contain Hosting assets to be uploaded with > firebase deploy. If you have a build process for your assets, use your > build's output directory. > > ? What do you want to use as your public directory? build ? Configure > as a single-page app (rewrite all urls to /index.html)? Yes ? Set up > automatic builds and deploys with GitHub? No > > Error: Failed to make request to > https://www.gstatic.com/firebasejs/releases.json
我也试过做 firebase init --debug,它给了我这个错误:
[2021-08-20T07:48:26.003Z] >>> [apiv2][query] GET https://www.gstatic.com/firebasejs/releases.json [none]
[2021-08-20T07:48:26.810Z] FetchError: request to https://www.gstatic.com/firebasejs/releases.json failed, reason: unable to get local issuer certificate
at ClientRequest.<anonymous> (C:\Users\Swapnil\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\node-fetch\lib\index.js:1461:11)
at ClientRequest.emit (events.js:400:28)
at ClientRequest.emit (domain.js:470:12)
at TLSSocket.socketErrorListener (_http_client.js:475:9)
at TLSSocket.emit (events.js:400:28)
at TLSSocket.emit (domain.js:470:12)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Error: Failed to make request to https://www.gstatic.com/firebasejs/releases.json
我也尝试过 npm audit 和 npm audit --force,但没有用
我的文件:
节点不允许我在未授权时使用互联网
我使用 运行 这个命令解决了错误:
set NODE_TLS_REJECT_UNAUTHORIZED=0