Firebase-tools: Firebase 部署命令失败(错误必须在每个“托管”配置中提供“站点”或“目标”。)

创建于 2020-03-01  ·  3评论  ·  资料来源: firebase/firebase-tools

我尝试运行命令“firebase deploy”以将应用程序部署到 Firebase,但出现了标题中括号中提到的错误:

 Error: Must supply either "site" or "target" in each "hosting" config.

这是我的 .firebaserc 文件目前的样子:
```.firebaserc
{
“项目”:{
“默认”:“phonestore-4e40c”
},
“目标”:{
“phonestore-4e40c”:{
“主持”:{
“电话商店”:[
“phonestore-4e40c”
]
}
}
}
}

What do I do here to fix the error?  I tried adding `"target":` before `"phonestore-4e40c"` (it would become `"target": "phonestore-4e40c"`) but that didn't work either; it gave me this error:

! 尝试加载 E:\programming\angular\phone-store.firebaserc 时出现 JSON 错误

=== 正在部署到“phonestore-4e40c”...

我部署托管

错误:必须在每个“托管”配置中提供“站点”或“目标”。

(This is almost the same as the one I got when I ran just `firebase deploy`; the only thing new is the line about a JSON error).  

Any help with this is much appreciated.  (Note: The reason I didn't open a "Bug Report" issue is that I wasn't sure if my issue qualifies as a bug report.)

Before that I had tried the `ng deploy` command since I was following the Angular Getting Started Tutorial and had gotten to the deployment part after following the whole thing ([here](https://angular.io/start/start-deployment)).  I'd chosen to deploy it to Firebase after downloading it to my computer.  The result of that was this:

ng部署
打造“手机店”
为差分加载生成 ES5 包...
ES5 包生成完成。

块 {2} polyfills-es2015.d39e6b85441999f66523.js (polyfills) 35.6 kB [initial] [rendered]
块 {3} polyfills-es5.bb7828de73427b5cd027.js (polyfills-es5) 128 kB [initial] [rendered]
块{0} runtime-es2015.0811dcefd377500b5b1a.js(运行时)1.45 kB [entry] [rendered]
块{0} runtime-es5.0811dcefd377500b5b1a.js(运行时)1.45 kB [entry] [rendered]
块{1} main-es2015.d600346e98d8457cc378.js (main) 277 kB [initial] [rendered]
块{1} main-es5.d600346e98d8457cc378.js (main) 337 kB [initial] [rendered]
块{4}styles.f1fcab432634cda74b08.css(样式)1.68 kB [initial] [rendered]
日期:2020-03-01T15:29:58.651Z - 哈希:3f6a31e9de18891acf13 - 时间:40448ms
RangeError:超出最大调用堆栈大小
在 formatError (internal/util/inspect.js:1095:20)
在 formatRaw (internal/util/inspect.js:883:14)
在 formatValue (internal/util/inspect.js:737:10)
在检查 (internal/util/inspect.js:280:10)
在 formatWithOptionsInternal (internal/util/inspect.js:1886:40)
在格式 (internal/util/inspect.js:1762:10)
在 Object.console.warn (E:\programming\angular\phone-store\node_modules\@angular\cli\lib\cli\index.js:46:35)
在 Observable._trySubscribe (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Observable.js:55:25)
在 Observable.subscribe (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Observable.js:30:22)
在 MergeMapOperator.call (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\operators\mergeMap.js:39:23)
在 Observable.subscribe (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Observable.js:25:31)
在 IgnoreElementsOperator.call (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\operators\ignoreElements.js:27:23)
在 Observable.subscribe (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Observable.js:25:31)
在 Object.subscribeToResult (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\util\subscribeToResult.js:12:23)
在 MergeMapSubscriber._innerSub (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\operators\mergeMap.js:82:29)
在 MergeMapSubscriber._tryNext (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\operators\mergeMap.js:76:14)
在 MergeMapSubscriber._next (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\operators\mergeMap.js:59:18)
在 MergeMapSubscriber.Subscriber.next (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Subscriber.js:66:18)
在 Observable._subscribe (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\util\subscribeToArray.js:5:20)
在 Observable._trySubscribe (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Observable.js:44:25)
在 Observable.subscribe (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\Observable.js:30:22)
在 MergeMapOperator.call (E:\programming\angular\phone-store\node_modules\@angular-devkit\core\node_modules\rxjs\internal\operators\mergeMap.js:39:23)
`` Would be good if I could get this to work. If not, then the firebase deploy` 命令也很好用。

最有用的评论

好吧,一定发生了一些奇怪的事情,因为我再次运行了ng deploy并且这次它起作用了。

所有3条评论

好吧,一定发生了一些奇怪的事情,因为我再次运行了ng deploy并且这次它起作用了。

谢谢@DragonOsmanfirebase deploy命令不起作用,我必须使用ng deploy命令。

遇到相同的错误,但找到了解决方法。
在 firebase.json 配置文件中添加额外的行“target”:“app”后,“firebase deploy”对我有用,如下所示:

{
“主持”:[
{
“目标”:“应用程序”,
"公共": "www",
...

此页面是否有帮助?
0 / 5 - 0 等级