我正在尝试按照本教程使用Node.js将图像发送到Google Vision API:https://cloud.google.com/vision/docs/libraries

我已经安装了客户端库 . 然后,我创建了一个服务帐户密钥,并将GOOGLE_APPLICATION_CREDENTIALS环境变量的值显式设置为在创建服务帐户密钥时下载的JSON文件 .

但是,当我运行以下Node.js代码时:

// Imports the Google Cloud client library
const vision = require('@google-cloud/vision');

// Creates a client
const client = new vision.ImageAnnotatorClient();

// Performs label detection on the image file
client
  .labelDetection('./Driver_license.jpg')
  .then(results => {
    const labels = results[0].labelAnnotations;

    console.log('Labels:');
    labels.forEach(label => console.log(label.description));
  })
  .catch(err => {
    console.error('ERROR:', err);
  });

我在控制台中收到以下2个错误:

(node:22585)DeprecationWarning:grpc.load:使用带有grpc.loadPackageDefinition的@ grpc / proto-loader模块而不是Auth错误:错误:证书链中的自签名证书

关于Auth错误的第二个错误继续一遍又一遍地打印出来,直到我终止执行 .

我已经密切关注了Google Cloud教程,所以我不确定为什么这不起作用 . 我错过了认证中的一步吗?