2

根据 Google/Firebase.io 对 Divshot.io 的收购,我需要在 2015 年 12 月 22 日之前迁移我的生产“静态”HTML 应用程序。我已经安装了最新的firebase-toolsCLI 并更新到了最新的divshotCLI 并准备了我的环境。

我已遵循divshot的所有指导,但在尝试执行以下操作时收到以下错误deploy

Jeffs-rMBP:insider-web jeff [develop] $ cp -p divshot.production.json divshot.json
Jeffs-rMBP:insider-web jeff [develop] $ divshot migrate

Migrating Divshot app insider-web to Firebase Hosting

What is your Firebase project's name? (insider-web) insider
Can we anonymously report which features your app used (for Firebase Hosting roadmap planning, etc.)? (y/n) y
Write firebase.json? (y/n) y

⚠ Warning: The following incompatible features were detected.
- clean_urls support is planned for Firebase Hosting, but is not yet available
- Firebase Hosting does not support AJAX proxying

  Don't panic! Some features may be coming soon or there may be workarounds.
  Contact support@firebase.com with any questions.

You need to take the following actions to fully migrate your app:
- Rename error.html to 404.html

Wrote firebase.json configuration file.

If you have the latest version of firebase-tools you should now be able
to run firebase serve in this directory to start a local server and
firebase deploy to deploy to Firebase Hosting.

See http://docs.divshot.com/migrate for additional migration info.

Jeffs-rMBP:insider-web jeff [develop] $ 

我遵循了每次重命名的error.html指导404.html

Jeffs-rMBP:insider-web jeff [develop] $ cp -p error.html 404.html
Jeffs-rMBP:insider-web jeff [develop] $ 

到目前为止看起来不错,但在尝试部署后,我收到以下消息:

Jeffs-rMBP:insider-web jeff [develop] $ firebase deploy

Error: Authentication required.
Jeffs-rMBP:insider-web jeff [develop] $ 

这是我的原始divshot.json文件:

Jeffs-rMBP:insider-web jeff [develop] $ cat divshot.json
{
  "name": "insider-web",
  "root": "./",
  "clean_urls": true,
  "error_page": "error.html",
  "proxy": {
    "api": {
      "origin": "http://oa-mobile.herokuapp.com",
      "headers": {
        "Accept": "application/json"
      },
      "cookies": false,
      "timeout": 30
    }
  }
}
Jeffs-rMBP:insider-web jeff [develop] $ 

这是生成的firebase.json文件:

Jeffs-rMBP:insider-web jeff [develop] $ cat firebase.json 
{
  "firebase": "insider",
  "public": "./",
  "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
  ]
}
Jeffs-rMBP:insider-web jeff [develop] $ 

附加说明:我能够在firebase serve本地成功运行和启动我的应用程序localhost:5000- 我的初始登录页面成功呈现并且行为正确。

4

1 回答 1

1

您需要通过命令行登录:

firebase login

这将打开一个浏览器窗口,供您通过您的 Google 帐户登录。确保它是拥有insiderFirebase 应用的帐户。

根据您所了解的,您当前拥有的唯一 Firebase 名为glowing-heat-3960. 更改firebase您的属性firebase.json

{
  "firebase": "glowing-heat-3960",
  "public": "./",
  "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
  ]
}

之后,您应该能够成功部署。

于 2015-12-11T03:24:13.693 回答