I am debugging a lambda function locally on Node 4.3 using the standard Amazon Machine Image (linux x64)
When I run the program, I get an error in a function that is meant to decode a base64 string to utf-8. The error says
Unhandled rejection TypeError: base64 is not a function
at Function.from (native)
at Function.from (native)
at /home/ec2-user/sass-compiler/lib/compiler.module.js:26:30
My code seems rather simple. I have checked around SO and the node 4.3 docs and my code seems compliant. Any ideas what I might be doing wrong?
template() {
return new Promise((resolve, reject) => {
let buf = Buffer.from(this._opts.tpl, 'base64').toString('utf-8');
let _tpl = _.template(buf);
resolve(_tpl(this._opts.opts));
});
}
EDIT The program works just fine on Windows 10 using Node LTS 6.9.5