TypeError: AWS.rekognition is not a constructor
TypeError: AWS.rekognition is not a constructor
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。
new AWS.Rekognition();
基本上是大写R
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。
new AWS.Rekognition();
基本上是大写R