2017-07-25 4 views
0

Ich versuche, diese Google-API zu verwenden:Fehler bei Auth Google Video API

ich das Beispielprojekt heruntergeladen und die Schritte folgen, die:

1) CD-Projekt-Ordner API Video

2) NPM installieren

3) GCLOUD_PROJECT = neorisvideo

gesetzt 4) Ich heruntergeladen Json aus dem Credential und steckte ihn in den Projektordner

5) Ich lief der Befehl Knoten analyze.js Etiketten-Datei resources/cat.mp4

Und gab den folgenden Fehler:

ERROR: Error: Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information. at C:\Users\thiago.saad\Downloads\nodejs-docs-samples-master\nodejs-docs-samples-master\video\node_modules\google-auth-library\lib\auth\googleauth.js:316:21 at C:\Users\thiago.saad\Downloads\nodejs-docs-samples-master\nodejs-docs-samples-master\video\node_modules\google-auth-library\lib\auth\googleauth.js:346:7 at Request._callback (C:\Users\thiago.saad\Downloads\nodejs-docs-samples-master\nodejs-docs-samples-master\video\node_modules\google-auth-library\lib\transporters.js:70:30) at self.callback (C:\Users\thiago.saad\Downloads\nodejs-docs-samples-master\nodejs-docs-samples-master\video\node_modules\request\request.js:188:22) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at Request.onRequestError (C:\Users\thiago.saad\Downloads\nodejs-docs-samples-master\nodejs-docs-samples-master\video\node_modules\request\request.js:884:8) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at Socket.socketErrorListener (_http_client.js:309:9) (node:9196) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information. (node:9196) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information. (node:9196) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information. (node:9196) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): Error: Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information.

Antwort

0

Sie benötigen eine Umgebungsvariable zu erstellen, um die jSON-Datei Punkt:

GOOGLE_APPLICATION_CREDENTIALS=/home/user/project/google.json