exiftool-vendored.js: Error: spawn /var/task/node_modules/exiftool-vendored.pl/bin/exiftool ENOENT
exiftool can not be spawned in aws lambda environment, getting below error stack:
2019-07-18T14:45:17.836Z 288aa49b-491d-5394-a451-f131c125cf30 Error: spawn /var/task/node_modules/exiftool-vendored.pl/bin/exiftool ENOENT
at _errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
Using lambci/lambda:nodejs8.10 image (https://github.com/lambci/docker-lambda) the problem can be reproduced. The error happens when initializing the below Metadata class
export default class Metadata {
private static tool: ExifTool = Metadata.initTool();
public static tmpDirectory = `${tmpdir()}/metadata`;
private static initTool(): ExifTool {
logger.debug("initializing exiftool...");
const tool = new ExifTool();
tool.version().then(version => logger.info(`ExifTool version ${version}`));
return tool;
}
Thanks for the great tool
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 24 (8 by maintainers)
Cool, I’ll
hi, i dont use the library i was just passing by and see the error and try to help
Using
as the shebang line does not work, causes
works
On your lambda function exports.handler = function(event, context, callback) { const { spawn } = require( ‘child_process’ ), ls = spawn( ‘ls’, [ ‘/usr/bin’ ] );
};
you will see that perl is no there, if that your case
You have to : 1 - Add a layer on Lambda choose one from ->Perl LAYERS (that will install perl on AMI) 2 - Then on exiftool change
#!/usr/bin/perl -wfor#!/opt/bin/perl -wI have same issue using exiftool Lib, it seen that the new version of AMI in Lambda doesn’t have perl installed!