Использование Node.js deploy в функциях firebase - npm сломанный канал - PullRequest
1 голос
/ 16 марта 2020

Я пытаюсь использовать функцию развертывания firebase с Node.js, но появляется broken pipe error. Сброс Node.js с помощью Webstorm также не работает. Это ошибка npm (firebase-debug.log).

Error: An unexpected error has occurred.
Having trouble? Try again or contact support with the contents of firebase-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ deploy: `firebase deploy --only functions`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the functions@ deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\yyh\AppData\Roaming\npm-cache\_logs\2020-03-16T12_16_08_761Z-debug.log   
[debug] [2020-03-16T11:11:24.097Z] ----------------------------------------------------------------------
[debug] [2020-03-16T11:11:24.099Z] Command:       C:\Program Files\nodejs\node.exe C:\Users\yyh\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js deploy --only functions
[debug] [2020-03-16T11:11:24.099Z] CLI Version:   7.15.0
[debug] [2020-03-16T11:11:24.099Z] Platform:      win32
[debug] [2020-03-16T11:11:24.099Z] Node Version:  v12.16.1
[debug] [2020-03-16T11:11:24.100Z] Time:          Mon Mar 16 2020 19:11:24 GMT+0800 (GMT+08:00)
[debug] [2020-03-16T11:11:24.100Z] ----------------------------------------------------------------------
[debug] [2020-03-16T11:11:24.100Z] 
[debug] [2020-03-16T11:11:24.113Z] > 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-03-16T11:11:24.114Z] > authorizing via signed-in user
[debug] [2020-03-16T11:11:24.114Z] [iam] checking project server-83bb6 for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]
[debug] [2020-03-16T11:11:24.116Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/server-83bb6:testIamPermissions  
[debug] [2020-03-16T11:11:25.068Z] <<< HTTP RESPONSE 200
[debug] [2020-03-16T11:11:25.181Z] SyntaxError: Unexpected token A in JSON at position 0
    at JSON.parse (<anonymous>)
    at Socket.<anonymous> (C:\Users\yyh\AppData\Roaming\npm\node_modules\firebase-tools\lib\checkFirebaseSDKVersion.js:25:31)
    at Socket.emit (events.js:311:20)
    at Socket.EventEmitter.emit (domain.js:482:12)
    at addChunk (_stream_readable.js:294:12)
    at readableAddChunk (_stream_readable.js:275:11)
    at Socket.Readable.push (_stream_readable.js:209:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)
[error] 
[error] Error: An unexpected error has occurred.

Что приводит к сбою при развертывании функции на базе firebase?

...