Could not load the default credentials? (Node.js Google Compute Engine tutorial)

后端 未结 14 1615
情话喂你
情话喂你 2020-12-04 19:20

SITUATION:

I follow this tutorial: https://cloud.google.com/nodejs/tutorials/bookshelf-on-compute-engine

Everything works fine until I do

14条回答
  •  醉话见心
    2020-12-04 19:42

    You have to create an object of your SessionsClient. Here I will provide some steps, so you can run your code like a charm.

    1. You have to go into your Dialogflow dashboard.
    2. Click on setting ( Left navbar top-right gear icon)
    3. in the General tab click Service Account link ( it will redirect you to another screen)
    4. If you have a service account then ignore step 5
    5. Create a service account ( Top-center +icon button)
      • Now you have a service account on a list click on
    6. From the action, field presses the 3 vertical dots and create a key.
    7. Download the JSON file on your local computer.
    8. Assign object to your sessionClient.
    const sessionClient = new dialogflow.SessionsClient({
     keyFilename: "/var/www/html/moqatrips/dialog-flow.json"
    });
    

提交回复
热议问题