“An unexpected error has occurred” after firebase deploy

前端 未结 14 1144
无人及你
无人及你 2020-12-20 14:53

When I am hosting my web page through firebase hosting then after writing command firebase deploy I got the following error:

Microsoft Windows [Versi         


        
相关标签:
14条回答
  • 2020-12-20 15:19

    In my case, this error occurred when I had not set the site name in firebase.json.

    Example of the firebase.json with site highlighted

    0 讨论(0)
  • 2020-12-20 15:20

    In my case, resolve with:

    firebase deploy --except functions
    
    0 讨论(0)
  • 2020-12-20 15:20

    It could be due to npm and node version For mac os, you can update npm using command:

    npm install -g npm@latest
    

    and update node directly by going to link https://nodejs.org/en/ and download installer. and run

    npm install -g firebase-tools
    

    For removing firebase hosting deployment errors (also if you are updating existing hosted site) you can do process again 1] firebase login 2] firebase init 3] firebase deploy

    Make sure your current folder has two things: public folder (which contains all files index.html) And firebase.json file

    0 讨论(0)
  • 2020-12-20 15:24

    If you still are serving your site on localhost using firebase serve it might cause problems. Shut it down then try the deploy. Worked for me.

    0 讨论(0)
  • 2020-12-20 15:26

    Yes I've faced this issue.. This is because of my node version I was using Node v.8.0.0 I just downgrade it to Node v.16.0.3 and then my deployment done :)

    0 讨论(0)
  • 2020-12-20 15:27

    Make sure that you are logged in by running firebase login in the terminal.

    0 讨论(0)
提交回复
热议问题