“发生了意外错误". Firebase部署后 [英] "An unexpected error has occurred" after firebase deploy
本文介绍了“发生了意外错误". Firebase部署后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我通过Firebase托管来托管网页时,在编写命令firebase deploy
之后,出现以下错误:
When I am hosting my web page through firebase hosting then after writing command firebase deploy
I got the following error:
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Users\amarg\Desktop\amar>firebase init
######## #### ######## ######## ######## ### ###### ########
## ## ## ## ## ## ## ## ## ## ##
###### ## ######## ###### ######## ######### ###### ######
## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######## ######## ## ## ###### ########
You're about to initialize a Firebase project in this directory:
C:\Users\amarg\Desktop\amar
Before we get started, keep in mind:
* You are initializing in an existing Firebase project directory
? Are you ready to proceed? Yes
? What Firebase CLI features do you want to setup for this folder? Hosting: Configure and deploy Firebase Hosting sites
=== 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.
i .firebaserc already has a default project, skipping
=== 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? public
? Configure as a single-page app (rewrite all urls to /index.html)? No
? File public/404.html already exists. Overwrite? No
i Skipping write of public/404.html
? File public/index.html already exists. Overwrite? No
i Skipping write of public/index.html
i Writing configuration info to firebase.json...
i Writing project information to .firebaserc...
+ Firebase initialization complete!
C:\Users\amarg\Desktop\amar>firebase deploy
=== Deploying to 'learningweb-6b2a3'...
i deploying hosting
+ database: rules ready to deploy.
i hosting: preparing public directory for upload...
Error: An unexpected error has occurred.
C:\Users\amarg\Desktop\amar>
推荐答案
对我来说,更新firebase-tools解决了该问题
For me updating firebase-tools solved the issue
在cmd提示符下运行以下命令
run below command in your cmd prompt
npm install -g firebase-tools
然后再次尝试将Firebase初始化
then try firebase init again
这篇关于“发生了意外错误". Firebase部署后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文