javascript - TypeError:AWS.rekognition 不是构造函数
问题描述
const AWS = require('aws-sdk')
AWS.config.loadFromPath('./credentials.json');
AWS.config.update({region:'us-east-1'});
var rekognition = new AWS.rekognition();
var params = {
CollectionId: "sammple",
DetectionAttributes: [
],
ExternalImageId: "facialrekogntition", //TODo
Image: {
S3Object: {
Bucket: "facerekognition12",
Name: "download.jpg"
}
}
};
rekognition.indexFaces(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
每当我使用时,都会node index.js
收到标题中提到的错误。
注意- 我的凭证存储在 JSON 文件中,并且还安装了 AWS-SDK for node。
解决方案
基本new AWS.Rekognition();
都是资本R
推荐阅读
- c# - dbo.AspNetUsers 表上的 ASP.NET MVC 5 Core Identity CompanyID 外键
- android - Kotlin Mockk 错误:在 verify { ... } 块中缺少调用
- angular - 如何使用字符串引用 ng-template?
- javascript - TABULATOR - Mutator 不显示数据
- reactjs - Auth0 as SP:React 应用程序接收 SAML 响应,而不是带有代码和状态参数的重定向
- wordpress - 使用 Route 53 的 ELB 上的意外行为
- python - 将一个范围内的所有 x 值分箱然后取每个箱中所有 y 值的平均值的最佳方法?
- javascript - 使用jQuery滑块通过串行发送数据
- pandas - Pandas 数据框操作逻辑
- string - 如何将 QStringView 与 QML 一起使用?