firebase / firebase-tools

The Firebase Command Line Tools
MIT License
4.01k stars 926 forks source link

"an unexpected error has occurred" during firebase init #2509

Closed yogickori closed 4 years ago

yogickori commented 4 years ago

i ran the command npm install -g firebase-tools. which was showing deprecated to a few files, but was installed at the end. after that when i ran firebase init, an unexpected error has occurred was showing. i have attached the debug file here

[debug] [2020-07-30T21:07:21.901Z] ----------------------------------------------------------------------
[debug] [2020-07-30T21:07:21.903Z] Command:       C:\Program Files\nodejs\node.exe C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js init
[debug] [2020-07-30T21:07:21.904Z] CLI Version:   8.6.0
[debug] [2020-07-30T21:07:21.904Z] Platform:      win32
[debug] [2020-07-30T21:07:21.904Z] Node Version:  v12.18.3
[debug] [2020-07-30T21:07:21.905Z] Time:          Fri Jul 31 2020 02:37:21 GMT+0530 (India Standard Time)
[debug] [2020-07-30T21:07:21.905Z] ----------------------------------------------------------------------
[debug] [2020-07-30T21:07:21.906Z] 
[debug] [2020-07-30T21:07:21.913Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2020-07-30T21:07:21.914Z] > authorizing via signed-in user
[info] 
     ######## #### ########  ######## ########     ###     ######  ########
     ##        ##  ##     ## ##       ##     ##  ##   ##  ##       ##
     ######    ##  ########  ######   ########  #########  ######  ######
     ##        ##  ##    ##  ##       ##     ## ##     ##       ## ##
     ##       #### ##     ## ######## ########  ##     ##  ######  ########

You're about to initialize a Firebase project in this directory:

  C:\something

Before we get started, keep in mind:

  * You are currently outside your home directory

[info] 
=== Project Setup
[info] 
[info] First, let's associate this project directory with a Firebase project.
[info] You can create multiple project aliases by running firebase use --add, 
[info] but for now we'll just set up a default project.
[info] 
[debug] [2020-07-30T21:07:42.650Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects?pageSize=100  

[debug] [2020-07-30T21:07:43.626Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Thu, 30 Jul 2020 21:07:26 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[info] i  Using project clone-b0d01 (clone) 
[info] 
=== Database Setup
[info] 
[info] Firebase Realtime Database Rules allow you to define how your data should be
[info] structured and when your data can be read from and written to.
[info] 
[debug] [2020-07-30T21:07:54.789Z] >>> HTTP REQUEST GET https://clone-b0d01.firebaseio.com/.settings/rules.json  

[debug] [2020-07-30T21:07:56.479Z] <<< HTTP RESPONSE 200 {"server":"nginx","date":"Thu, 30 Jul 2020 21:07:39 GMT","content-type":"application/json; charset=utf-8","content-length":"161","connection":"keep-alive","access-control-allow-origin":"*","cache-control":"no-cache","strict-transport-security":"max-age=31556926; includeSubDomains; preload"}
[info] +  Database Rules for clone-b0d01 have been downloaded to public. 
[info] Future modifications to public will update Database Rules when you run
[info] firebase deploy.
[info] 
=== Hosting Setup
[info] 
[info] Your public directory is the folder (relative to your project directory) that
[info] will contain Hosting assets to be uploaded with firebase deploy. If you
[info] have a build process for your assets, use your build's output directory.
[info] 
[debug] [2020-07-30T21:08:07.022Z] >>> HTTP REQUEST GET https://www.gstatic.com/firebasejs/releases.json  

[debug] [2020-07-30T21:08:07.467Z] <<< HTTP RESPONSE 200 {"accept-ranges":"bytes","vary":"Accept-Encoding, Origin","content-type":"application/json","content-length":"1429","date":"Thu, 30 Jul 2020 20:32:45 GMT","expires":"Thu, 30 Jul 2020 21:22:45 GMT","last-modified":"Fri, 24 Jul 2020 05:16:40 GMT","x-content-type-options":"nosniff","server":"sffe","x-xss-protection":"0","cache-control":"public, max-age=3000","age":"2105","alt-svc":"h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""}
[debug] [2020-07-30T21:08:07.788Z] Error: ENOENT: no such file or directory, open 'C:\something\public\index.html'
    at Object.openSync (fs.js:462:3)
    at Object.writeFileSync (fs.js:1362:35)
    at Object.createFileSync (C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\fs-extra\lib\ensure\file.js:34:6)
    at Config.writeProjectFile (C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\lib\config.js:154:8)
    at C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\lib\config.js:173:18
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
[error] 
[error] Error: An unexpected error has occurred.
[debug] [2020-07-30T21:08:15.476Z] ----------------------------------------------------------------------
[debug] [2020-07-30T21:08:15.486Z] Command:       C:\Program Files\nodejs\node.exe C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js init
[debug] [2020-07-30T21:08:15.487Z] CLI Version:   8.6.0
[debug] [2020-07-30T21:08:15.488Z] Platform:      win32
[debug] [2020-07-30T21:08:15.488Z] Node Version:  v12.18.3
[debug] [2020-07-30T21:08:15.493Z] Time:          Fri Jul 31 2020 02:38:15 GMT+0530 (India Standard Time)
[debug] [2020-07-30T21:08:15.494Z] ----------------------------------------------------------------------
[debug] [2020-07-30T21:08:15.494Z] 
[debug] [2020-07-30T21:08:15.566Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2020-07-30T21:08:15.568Z] > authorizing via signed-in user
[info] 
     ######## #### ########  ######## ########     ###     ######  ########
     ##        ##  ##     ## ##       ##     ##  ##   ##  ##       ##
     ######    ##  ########  ######   ########  #########  ######  ######
     ##        ##  ##    ##  ##       ##     ## ##     ##       ## ##
     ##       #### ##     ## ######## ########  ##     ##  ######  ########

You're about to initialize a Firebase project in this directory:

  C:\something

Before we get started, keep in mind:

  * You are currently outside your home directory

[info] 
=== Project Setup
[info] 
[info] First, let's associate this project directory with a Firebase project.
[info] You can create multiple project aliases by running firebase use --add, 
[info] but for now we'll just set up a default project.
[info] 
[debug] [2020-07-30T21:08:32.542Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects?pageSize=100  

[debug] [2020-07-30T21:08:33.239Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Thu, 30 Jul 2020 21:08:16 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[info] i  Using project clone-b0d01 (clone) 
[info] 
=== Database Setup
[info] 
[info] Firebase Realtime Database Rules allow you to define how your data should be
[info] structured and when your data can be read from and written to.
[info] 
[debug] [2020-07-30T21:08:41.258Z] >>> HTTP REQUEST GET https://clone-b0d01.firebaseio.com/.settings/rules.json  

[debug] [2020-07-30T21:08:42.676Z] <<< HTTP RESPONSE 200 {"server":"nginx","date":"Thu, 30 Jul 2020 21:08:25 GMT","content-type":"application/json; charset=utf-8","content-length":"161","connection":"keep-alive","access-control-allow-origin":"*","cache-control":"no-cache","strict-transport-security":"max-age=31556926; includeSubDomains; preload"}
[info] +  Database Rules for clone-b0d01 have been downloaded to public. 
[info] Future modifications to public will update Database Rules when you run
[info] firebase deploy.
[info] 
=== Hosting Setup
[info] 
[info] Your public directory is the folder (relative to your project directory) that
[info] will contain Hosting assets to be uploaded with firebase deploy. If you
[info] have a build process for your assets, use your build's output directory.
[info] 
[debug] [2020-07-30T21:08:59.467Z] >>> HTTP REQUEST GET https://www.gstatic.com/firebasejs/releases.json  

[debug] [2020-07-30T21:08:59.769Z] <<< HTTP RESPONSE 200 {"accept-ranges":"bytes","vary":"Accept-Encoding, Origin","content-type":"application/json","content-length":"1429","date":"Thu, 30 Jul 2020 20:32:45 GMT","expires":"Thu, 30 Jul 2020 21:22:45 GMT","last-modified":"Fri, 24 Jul 2020 05:16:40 GMT","x-content-type-options":"nosniff","server":"sffe","x-xss-protection":"0","cache-control":"public, max-age=3000","age":"2158","alt-svc":"h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""}
[debug] [2020-07-30T21:09:00.090Z] Error: ENOENT: no such file or directory, open 'C:\something\public\index.html'
    at Object.openSync (fs.js:462:3)
    at Object.writeFileSync (fs.js:1362:35)
    at Object.createFileSync (C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\fs-extra\lib\ensure\file.js:34:6)
    at Config.writeProjectFile (C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\lib\config.js:154:8)
    at C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\lib\config.js:173:18
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
[error] 
[error] Error: An unexpected error has occurred.
[debug] [2020-07-31T07:27:35.596Z] ----------------------------------------------------------------------
[debug] [2020-07-31T07:27:35.625Z] Command:       C:\Program Files\nodejs\node.exe C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js init
[debug] [2020-07-31T07:27:35.627Z] CLI Version:   8.6.0
[debug] [2020-07-31T07:27:35.628Z] Platform:      win32
[debug] [2020-07-31T07:27:35.629Z] Node Version:  v12.18.3
[debug] [2020-07-31T07:27:35.640Z] Time:          Fri Jul 31 2020 12:57:35 GMT+0530 (India Standard Time)
[debug] [2020-07-31T07:27:35.642Z] ----------------------------------------------------------------------
[debug] [2020-07-31T07:27:35.644Z] 
[debug] [2020-07-31T07:27:35.718Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2020-07-31T07:27:35.724Z] > authorizing via signed-in user
[info] 
     ######## #### ########  ######## ########     ###     ######  ########
     ##        ##  ##     ## ##       ##     ##  ##   ##  ##       ##
     ######    ##  ########  ######   ########  #########  ######  ######
     ##        ##  ##    ##  ##       ##     ## ##     ##       ## ##
     ##       #### ##     ## ######## ########  ##     ##  ######  ########

You're about to initialize a Firebase project in this directory:

  C:\something

Before we get started, keep in mind:

  * You are currently outside your home directory

[info] 
=== Project Setup
[info] 
[info] First, let's associate this project directory with a Firebase project.
[info] You can create multiple project aliases by running firebase use --add, 
[info] but for now we'll just set up a default project.
[info] 
[debug] [2020-07-31T07:28:04.050Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] [2020-07-31T07:28:04.054Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token  
 <request body omitted>
[debug] [2020-07-31T07:28:05.399Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Fri, 31 Jul 2020 07:27:47 GMT","server":"scaffolding on HTTPServer2","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-07-31T07:28:05.584Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects?pageSize=100  

[debug] [2020-07-31T07:28:07.556Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Fri, 31 Jul 2020 07:27:50 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[info] i  Using project clone-b0d01 (clone) 
[info] 
=== Database Setup
[info] 
[info] Firebase Realtime Database Rules allow you to define how your data should be
[info] structured and when your data can be read from and written to.
[info] 
[debug] [2020-07-31T07:28:18.787Z] >>> HTTP REQUEST GET https://clone-b0d01.firebaseio.com/.settings/rules.json  

[debug] [2020-07-31T07:28:20.899Z] <<< HTTP RESPONSE 200 {"server":"nginx","date":"Fri, 31 Jul 2020 07:28:03 GMT","content-type":"application/json; charset=utf-8","content-length":"161","connection":"keep-alive","access-control-allow-origin":"*","cache-control":"no-cache","strict-transport-security":"max-age=31556926; includeSubDomains; preload"}
[info] +  Database Rules for clone-b0d01 have been downloaded to database.rules.json. 
[info] Future modifications to database.rules.json will update Database Rules when you run
[info] firebase deploy.
[info] 
=== Hosting Setup
[info] 
[info] Your public directory is the folder (relative to your project directory) that
[info] will contain Hosting assets to be uploaded with firebase deploy. If you
[info] have a build process for your assets, use your build's output directory.
[info] 
[debug] [2020-07-31T07:28:40.584Z] >>> HTTP REQUEST GET https://www.gstatic.com/firebasejs/releases.json  

[debug] [2020-07-31T07:28:44.602Z] <<< HTTP RESPONSE 200 {"accept-ranges":"bytes","vary":"Accept-Encoding, Origin","content-type":"application/json","content-length":"1429","date":"Fri, 31 Jul 2020 07:28:27 GMT","expires":"Fri, 31 Jul 2020 08:18:27 GMT","last-modified":"Fri, 24 Jul 2020 05:16:40 GMT","x-content-type-options":"nosniff","server":"sffe","x-xss-protection":"0","cache-control":"public, max-age=3000","age":"0","alt-svc":"h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""}
[debug] [2020-07-31T07:28:48.282Z] Error: ENOENT: no such file or directory, open 'C:\something\public\index.html'
    at Object.openSync (fs.js:462:3)
    at Object.writeFileSync (fs.js:1362:35)
    at Object.createFileSync (C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\fs-extra\lib\ensure\file.js:34:6)
    at Config.writeProjectFile (C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\lib\config.js:154:8)
    at C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\lib\config.js:173:18
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
[error] 
[error] Error: An unexpected error has occurred.
[debug] [2020-07-31T07:29:17.999Z] ----------------------------------------------------------------------
[debug] [2020-07-31T07:29:18.001Z] Command:       C:\Program Files\nodejs\node.exe C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js init
[debug] [2020-07-31T07:29:18.002Z] CLI Version:   8.6.0
[debug] [2020-07-31T07:29:18.002Z] Platform:      win32
[debug] [2020-07-31T07:29:18.002Z] Node Version:  v12.18.3
[debug] [2020-07-31T07:29:18.003Z] Time:          Fri Jul 31 2020 12:59:18 GMT+0530 (India Standard Time)
[debug] [2020-07-31T07:29:18.004Z] ----------------------------------------------------------------------
[debug] [2020-07-31T07:29:18.004Z] 
[debug] [2020-07-31T07:29:18.018Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2020-07-31T07:29:18.019Z] > authorizing via signed-in user
[info] 
samtstern commented 4 years ago

This error is in the logs multiple times:

[debug] [2020-07-30T21:08:07.788Z] Error: ENOENT: no such file or directory, open 'C:\something\public\index.html'
    at Object.openSync (fs.js:462:3)
    at Object.writeFileSync (fs.js:1362:35)
    at Object.createFileSync (C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\fs-extra\lib\ensure\file.js:34:6)
    at Config.writeProjectFile (C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\lib\config.js:154:8)
    at C:\Users\Yogi\AppData\Roaming\npm\node_modules\firebase-tools\lib\config.js:173:18
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

Are you running firebase init inside C:\something? If so is there already a firebase.json file there?

google-oss-bot commented 4 years ago

Hey @yogickori. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 4 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@yogickori if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.