无法使用cli登录firebase

时间:2016-11-19 02:22:51

标签: powershell firebase npm firebase-tools

我目前正在关注使用firebase创建网络应用的tutorial,我无法使用firebase login登录。我已经按照这一步骤进行了操作。 firebase version表示它是3.1.0,因此已正确安装。我在Windows 10上运行Powershell(在cmd上运行时的结果相同)。我不确定这是与firebase相关的内容,还是与npm相关(因为我之前从未使用过它)。非常感谢任何帮助,谢谢!

这是我尝试登录时的输出:

PS C:\Users\Tyler> firebase login --debug
----------------------------------------------------------------------
Command:      C:\Program Files\nodejs\node.exe C:\Users\Tyler\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase login --debug
CLI Version:  3.1.0
Platform:     win32
Node Version: v7.1.0
Time:         Fri Nov 18 2016 18:05:11 GMT-0800 (Pacific Standard Time)
----------------------------------------------------------------------

Error: write EINVAL
    at exports._errnoException (util.js:1022:11)
    at WriteStream.Socket._writeGeneric (net.js:715:26)
    at WriteStream.Socket._write (net.js:734:8)
    at doWrite (_stream_writable.js:334:12)
    at writeOrBuffer (_stream_writable.js:320:5)
    at WriteStream.Writable.write (_stream_writable.js:247:11)
    at WriteStream.Socket.write (net.js:661:40)
    at MuteStream.ondata (stream.js:31:26)
    at emitOne (events.js:96:13)
    at MuteStream.emit (events.js:188:7)

Error: An unexpected error has occurred.
Error: This socket is closed
    at WriteStream.Socket._writeGeneric (net.js:683:19)
    at WriteStream.Socket._write (net.js:734:8)
    at doWrite (_stream_writable.js:334:12)
    at writeOrBuffer (_stream_writable.js:320:5)
    at WriteStream.Writable.write (_stream_writable.js:247:11)
    at WriteStream.Socket.write (net.js:661:40)
    at Console.log (console.js:43:16)
    at module.exports.UI.onForceClose (C:\Users\Tyler\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\inquirer\lib\ui\baseUI.js:35:11)
    at emitOne (events.js:101:20)
    at process.emit (events.js:188:7)

Error: An unexpected error has occurred.
Error: This socket is closed
    at WriteStream.Socket._writeGeneric (net.js:683:19)
    at WriteStream.Socket._write (net.js:734:8)
    at doWrite (_stream_writable.js:334:12)
    at writeOrBuffer (_stream_writable.js:320:5)
    at WriteStream.Writable.write (_stream_writable.js:247:11)
    at WriteStream.Socket.write (net.js:661:40)
    at Console.log (console.js:43:16)
    at process.<anonymous> (C:\Users\Tyler\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase:76:17)
    at emitOne (events.js:101:20)
    at process.emit (events.js:188:7)

Error: An unexpected error has occurred.

我也尝试过使用--no-localhost选项但没有成功:

PS C:\Users\Tyler> firebase login --no-localhost --debug
----------------------------------------------------------------------
Command:      C:\Program Files\nodejs\node.exe C:\Users\Tyler\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase login --no-localhost --debug
CLI Version:  3.1.0
Platform:     win32
Node Version: v7.1.0
Time:         Fri Nov 18 2016 18:08:04 GMT-0800 (Pacific Standard Time)
----------------------------------------------------------------------

Error: write EINVAL
    at exports._errnoException (util.js:1022:11)
    at WriteStream.Socket._writeGeneric (net.js:715:26)
    at WriteStream.Socket._write (net.js:734:8)
    at doWrite (_stream_writable.js:334:12)
    at writeOrBuffer (_stream_writable.js:320:5)
    at WriteStream.Writable.write (_stream_writable.js:247:11)
    at WriteStream.Socket.write (net.js:661:40)
    at MuteStream.ondata (stream.js:31:26)
    at emitOne (events.js:96:13)
    at MuteStream.emit (events.js:188:7)

Error: An unexpected error has occurred.
Error: This socket is closed
    at WriteStream.Socket._writeGeneric (net.js:683:19)
    at WriteStream.Socket._write (net.js:734:8)
    at doWrite (_stream_writable.js:334:12)
    at writeOrBuffer (_stream_writable.js:320:5)
    at WriteStream.Writable.write (_stream_writable.js:247:11)
    at WriteStream.Socket.write (net.js:661:40)
    at Console.log (console.js:43:16)
    at process.<anonymous> (C:\Users\Tyler\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase:76:17)
    at emitOne (events.js:101:20)
    at process.emit (events.js:188:7)

Error: An unexpected error has occurred.
Error: This socket is closed
    at WriteStream.Socket._writeGeneric (net.js:683:19)
    at WriteStream.Socket._write (net.js:734:8)
    at doWrite (_stream_writable.js:334:12)
    at writeOrBuffer (_stream_writable.js:320:5)
    at WriteStream.Writable.write (_stream_writable.js:247:11)
    at WriteStream.Socket.write (net.js:661:40)
    at Console.log (console.js:43:16)
    at module.exports.UI.onForceClose (C:\Users\Tyler\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\inquirer\lib\ui\baseUI.js:35:11)
    at emitNone (events.js:86:13)
    at Interface.emit (events.js:185:7)

Error: An unexpected error has occurred.

1 个答案:

答案 0 :(得分:0)

好吧,看起来这是node / npm的一些持续问题。不完全确定这个问题是什么,但我认为它与following issue有关。从节点v7.1.0降级到节点v6.9.1并再次安装firebase-tools解决了这个问题。