Firebase Can't Deploy

你。 提交于 2020-08-08 07:01:32

问题


I have a firebase project I've been maintaining for months and haven't had any problems with.

I've tried running firebase deploy multiple times to no avail. I've googled it and searched on SO, github, and others, found these links, none of which worked. I've tried updating firebase tools, uninstalling and reinstalling, and everything between. Please don't blindly flag as duplicate without reading.

The first line of my error looks like this:

\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\winston\lib\winston\logger.js:307
  throw ex;

Here's my full output:

firebase deploy

C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\winston\lib\winston\logger.js:307 throw ex; ^

Error: write after end at writeAfterEnd (C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\winston\node_modules\readable-stream\lib_stream_writable.js:261:12) at PassThrough.Writable.write (C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\winston\node_modules\readable-stream\lib_stream_writable.js:305:21) at File.log (C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\winston\lib\winston\transports\file.js:185:34) at File._write (C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\winston-transport\index.js:103:17) at doWrite (C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\readable-stream\lib_stream_writable.js:428:64) at writeOrBuffer (C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\readable-stream\lib_stream_writable.js:417:5) at File.Writable.write (C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\readable-stream\lib_stream_writable.js:334:11) at DerivedLogger.ondata (C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\winston\node_modules\readable-stream\lib_stream_readable.js:681:20) at DerivedLogger.emit (events.js:203:15) at DerivedLogger.EventEmitter.emit (domain.js:448:20) at addChunk (C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\winston\node_modules\readable-stream\lib_stream_readable.js:298:12) at readableAddChunk (C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\winston\node_modules\readable-stream\lib_stream_readable.js:280:11) at DerivedLogger.Readable.push (C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\winston\node_modules\readable-stream\lib_stream_readable.js:241:10) at DerivedLogger.Transform.push (C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\winston\node_modules\readable-stream\lib_stream_transform.js:139:32) at DerivedLogger._transform (C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\winston\lib\winston\logger.js:305:12) at DerivedLogger.Transform._read (C:\Users\justi\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\winston\node_modules\readable-stream\lib_stream_transform.js:177:10)

I'm completely stuck on this, I've been searching for an hour, and I've never had this fail for me before, so I don't know what's going on with firebase. Thanks in advance.


回答1:


This probably an issue with NPM try running npm cache clean and reinstall firebase tools. If that didn't work try contacting firebase support. Recently I ran into an issue with firebase hosting and they were really helpful but took about 30 hours for their response after making the support ticket.




回答2:


For others that come this way, I had this exact error message and stack trace. I was attempting to run firebase deploy --except functions while following this code lab step.

For me the fix was simply to stop serving the firebase app locally for debug.

Once I had done this, no reboot, just back in the other terminal and submit the deploy command and it worked fine.

The code lab gets you to do this and then leave it served locally while changing various parts of the app, but I have no idea what caused winston to conflict this way.




回答3:


I had the exact same error, I tried restarting Command Prompt, deleting the cache file in the .firebase project folder. deploy worked fine with a separate test project.

On a whim I shut down my local server, and firebase deploy worked fine. Not sure if that's the real fix, as I'm 99.9% sure I did deploys in the past with the local server running... but it works for me now.

And after deploy was working again, it stopped a second time with the same error. So I stopped the server, and once again deploy worked. Then if failed a third time, same fix, shut down the local server.

Local server was run via firebase serve --only hosting

npm cache verify also checked out A-OK: https://docs.npmjs.com/cli-commands/cache.html



来源:https://stackoverflow.com/questions/62734278/firebase-cant-deploy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!