I want to use the textract API for document analysis, but when I tried to create an instance of AWS.Textract
it throws an error saying
module initialization error: TypeError
I tried different things, Initially I tries this,
const AWS = require('aws-sdk');
const Textract = new AWS.Textract();
it didn't work and said cannot find object
then after some googling, I found this link and adjusted the code to this
require('aws-sdk/clients/textract');
var textractClient = new AWS.Textract();
and this,
const Textract = require('aws-sdk/clients/textract');
var textractClient = new Textract();
None of these are working, what am doing wrong here?