Lui*_*rez 6 firebase firebase-hosting firebase-tools
I was stepping through this tutorial:
https://codelabs.developers.google.com/codelabs/firebase-web/#0
On step 9 it asks you to execute firebase deploy but when I try to do it I get the error message:
Could not read public directory. Remove links and shortcuts and try again.
I don't know what it means by links and shortcuts as far as I can tell there nothing in this folder but plain old files.
The folder I'm trying to deploy is the web folder which should contain the completed sample.
Note that as per the instructions the storage.rules was updated with the name of the bucket and the index.html was updated with the firebase snippet.
The firebase.json file looks like this:
{
"database": {
"rules": "database-rules.json"
},
"storage": {
"rules": "storage.rules"
},
"hosting": {
"public": "./",
"ignore": [
"firebase.json",
"database-rules.json",
"storage.rules"
]
}
}
Run Code Online (Sandbox Code Playgroud)
关于这个错误可能是什么的任何想法?有没有办法获得更详细的信息?
问题是 firebase-debug.log
结果发现该问题与配置无关。该问题实际上是文件权限问题firebase-debug.log。我通过将除该文件之外的所有内容复制到新文件夹并部署新文件夹来解决了该问题。
我是怎么发现的
因为无法从上面的错误消息中判断出这是问题所在。我认为引导您完成我用来发现问题的过程仍然有用。
Windows 10
首先,我想提一下,我使用的是 Windows 10 计算机,我不知道这是否相关,但为了以防万一,我想我会提一下。
1. 与工作项目比较
为了有一个基线/参考框架,我使用firebase init命令创建了一个新项目。
然后我尝试部署它。那是成功的,所以我知道部署总体上是有效的。
2.使用相同的firebase.json
然后,我从工作部署文件夹中获取自动生成的firebase.json文件,并替换部署不起作用的项目文件夹中的 firebase.json 文件。
当我尝试部署时,它仍然不起作用。
3.删除权限
此时我怀疑这是一个权限问题。所以我决定压缩该文件夹,然后将其解压缩到另一个文件夹。然后尝试部署新文件夹。
理论上,权限将在此过程中被删除。
当我尝试压缩文件时,我收到一条文件权限错误消息。有问题的文件的名称是firebase-debug.log. 这是您尝试部署时自动生成的文件。
firebase-debug.logfirebase deploy由命令自动生成
因此,我没有压缩和解压缩,而是复制了除此之外的所有文件firebase-debug.log并尝试部署它。
成功
有效!
但仍然不知道如何真正删除那个该死的文件。
| 归档时间: |
|
| 查看次数: |
2097 次 |
| 最近记录: |