簡體   English   中英

反應應用程序的 firebase 部署問題

[英]firebase deployment issue with a react app

我正在嘗試在 firebase 上部署我的反應應用程序,但我收到此錯誤:

錯誤:無法列出 Firebase 項目。 有關更多信息,請參閱 firebase-debug.log。

firebase-debug.log文件中顯示:

[info] 首先,讓我們將此項目目錄與 Firebase 項目相關聯。

[info] 您可以通過運行 firebase 使用 --add 創建多個項目別名,

[信息] 但現在我們只設置一個默認項目。

[信息] [調試] [2021-03-20T19:18:31.200Z] > 使用范圍刷新訪問令牌:[]

[調試] [2021-03-20T19:18:31.202Z] >>> HTTP 請求發布 https://www.googleapis.com/oauth2/v3/token

[調試] [2021-03-20T19:18:32.948Z] <<< HTTP 響應 200 {"expires":"Mon, 01 Jan 1990 00:00:00 GMT","cache-control":"no-cache , no-store, max-age=0, must-revalidate","date":"Sat, 20 Mar 2021 19:18:28 GMT","pragma":"no-cache","content-type": "application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"HTTPServer2 上的腳手架","x-xss-protection":"0 ","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=":443"; ma=2592000,h3- T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000, quic=":443"; ma=2592000; v="46,43"","accept-ranges":"none","transfer-encoding":"chunked"} [調試] [2021-03-20T19: 18:33.023Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects pageSize=100

[debug] [2021-03-20T19:18:35.619Z] Failed to make request: invalid json response body at https://firebase.googleapis.com/v1beta1/projects?pageSize=100 reason: Unexpected token < in JSON at position 0

[調試] [2021-03-20T19:18:37.235Z] FirebaseError:無法發出請求: https://firebase.googleapis.com/v=unected原因中的 json 響應正文無效: JSON 在 position 0 在 Client.request (C:\Users\john tucker\AppData\Roaming\npm\node_modules\firebase-tools\lib\apiv2.js:109:19) 在 process_TicksandRejections (internal/process/ 97:5)

[錯誤] [錯誤] 錯誤:未能列出 Firebase 項目。 有關更多信息,請參閱 firebase-debug.log。

我已經嘗試注銷並登錄,並確保我的應用程序存在於 firebase 控制台中。

當我在終端中鍵入 firebase init 時,我也會收到此錯誤:

(node:12720) UnhandledPromiseRejectionWarning: FirebaseError: 無法向https://firebase-public.firebaseio.com/cli.json在 Client.doRequest (C:\Users\n\node_aming\AppData\Ro\Users\n\node_aming\App\Data firebase-tools\lib\apiv2.js:211:19) 在 processTicksAndRejections (internal/process/task_queues.js:97:5)

(節點:12720) UnhandledPromiseRejectionWarning:未處理的 promise 拒絕。 此錯誤源於在沒有 catch 塊的情況下拋出異步 function 內部,或拒絕未使用.catch() 處理的 promise。 要終止未處理的 promise 拒絕的節點進程,請使用 CLI 標志--unhandled-rejections=strict (請參閱https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode )。 (拒絕編號:1)

(節點:12720)[DEP0018] DeprecationWarning:不推薦使用未處理的 promise 拒絕。 將來,未處理的 promise 拒絕將使用非零退出代碼終止 Node.js 進程。

您必須按照以下步驟使用基於火的托管在線部署您的 React 應用程序:

    npm run build => Run the following command to create a build directory with a production build of your app
 
    npm install -g firebase-tools => To host your site with Firebase Hosting, you need the Firebase command-line tool (CLI). Run the following npm command to install the CLI on your system globally

    firebase login => If you're not logged in, you'll be asked to enter the credentials for your google account.

    firebase init => to initialize firebase in your react app

    firebase deploy => Firebase will now run the deploying process and will give you a unique URL where your app is deployed

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM