groupe-sii / sonar-web-frontend-reporters

This is a repo of SII continuous integration build system dedicated to Front-end webapps.
22 stars 10 forks source link

Lower minimum node version? #13

Closed stevedenman closed 7 years ago

stevedenman commented 7 years ago

Hi, thanks for getting this working properly with npm 👍 . I was hoping to use version 3 in our CI pipeline on VS Team Services on their hosted agents (so I can't easily install different versions of software). They only have version 5.11.0 of node but it fails with error;

2016-12-06T20:55:29.9977163Z > sreporter 2016-12-06T20:55:29.9977163Z 2016-12-06T20:55:30.0936927Z C:\a\1\s\node_modules\sonar-web-frontend-reporters\bin\sreporter:10 2016-12-06T20:55:30.0936927Z class CLIEngine { 2016-12-06T20:55:30.0936927Z ^^^^^ 2016-12-06T20:55:30.0946922Z 2016-12-06T20:55:30.0946922Z SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode 2016-12-06T20:55:30.0946922Z at exports.runInThisContext (vm.js:53:16) 2016-12-06T20:55:30.0946922Z at Module._compile (module.js:387:25) 2016-12-06T20:55:30.0946922Z at Object.Module._extensions..js (module.js:422:10) 2016-12-06T20:55:30.0946922Z at Module.load (module.js:357:32) 2016-12-06T20:55:30.0946922Z at Function.Module._load (module.js:314:12) 2016-12-06T20:55:30.0946922Z at Function.Module.runMain (module.js:447:10) 2016-12-06T20:55:30.0946922Z at startup (node.js:148:18) 2016-12-06T20:55:30.0946922Z at node.js:405:3

I'm assuming this is due to node being < 6.9.1 .

ValentinGot commented 7 years ago

Hi,

This version is fully developped in ES2015/ES6 which is using the let, const, class keywords (among other things). That's why we are only compatible NodeJS 6.5 and greater. See the ES6 compatbility table over here: https://kangax.github.io/compat-table/es6/#node65.

We're going to try to make a transformed version with BabelJS to support NodeJS versions lower than 6.5. I'm keeping you up to date :)

ValentinGot commented 7 years ago

Done :)

You can now launch sreporter --es5 to use it with NodeJS versions < 6.9.1

See README for more details.