Cannot run when module is loaded
johnib opened this issue · comments
What can be done in order to run this module?
/Users/user/Desktop/app/node_modules/firehoser/firehoser.js:65
let [validRecords, invalidRecords] = this.validateRecords(records);
^
SyntaxError: Unexpected token [
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object.<anonymous> (/Users/user/Desktop/app/Firehose/test.js:80:17)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
Hi there @johnib,
Thanks for taking the time to report this issue. Can you please share more details of your runtime environment? It looks like your version of NodeJS doesn't support array destructuring, which is a recent addition to ECMAScript, and allows for the syntax used on this line.
I believe this syntax landed with the bulk of the ES6/ES2015 syntax in NodeJS 6.0. This module is written with a hard requirement of ES6.