matthewmueller / date

Date() for humans
http://matthewmueller.github.io/date/
1.48k stars 88 forks source link

drop support for old node versions #86

Closed OmgImAlexis closed 6 years ago

OmgImAlexis commented 6 years ago

Since LTS has finished for node versions older than 4 there's not really any point in still supporting them and one of the mocha deps doesn't work with older versions of node as it uses const in strict mode.

For example the last build.

/home/travis/build/matthewmueller/date/node_modules/mocha/node_modules/supports-color/index.js:2
const os = require('os');
^^^^^
SyntaxError: Use of const in strict mode.
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/travis/build/matthewmueller/date/node_modules/mocha/lib/reporters/base.js:11:46)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
make: *** [test] Error 1
matthewmueller commented 6 years ago

Hmm, I'd rather go in the other direction on this one. The main reason being that this was primarily built for the browsers and there are still some browsers that don't support const/let and other ES6 language features.

It's not a big deal for the tests, but if it's an easy fix like this one (add "use strict"), I'd rather add that than drop support.

OmgImAlexis commented 6 years ago

This is an issue with a dep so unless you want to send a PR to the dep you'll have to drop it to allow the tests to pass.

doowb commented 6 years ago

I recommend setting the version of mocha to 3.5.3 since that supports older versions of node. Then just add the newer versions of node to .travis.yml.