I'm trying to use HummusJS on a Lambda function using the Serverless framework for deployment.
The Hummus npm library needs a binary compiled to function. This (hummus.node) is provided in its node_modules folder. However when I require 'hummus' the library is throwing a bug.
const hummus = require('hummus');
module.exports.stamp = (event, context, callback) => {
const response = {
statusCode: 200,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Credentials': true,
'Content-Type': 'application/json'
},
body: JSON.stringify({ url: 'url' })
};
callback(null, response);
};
module initialization error: Error at Error (native) at Object.Module._extensions..node (module.js:597:18) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/var/task/pdf-manipulator/node_modules/hummus/hummus.js:5:31) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10)