mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
fix: add node@10, remove node@4
This is a non-breaking change, and only shows a warning once a week: [nodemon] WARNING: node@v4.8.7 is no longer maintained, nor supported by nodemon More information: https://github.com/nodejs/Release#end-of-life-releases
This commit is contained in:
@@ -5,10 +5,10 @@ cache:
|
||||
notifications:
|
||||
email: false
|
||||
node_js:
|
||||
- '10'
|
||||
- '9'
|
||||
- '8'
|
||||
- '6'
|
||||
- '4'
|
||||
before_install:
|
||||
- if [ "$TRAVIS_PULL_REQUEST_BRANCH" == "" ]; then echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> .npmrc; fi
|
||||
after_success:
|
||||
|
||||
@@ -272,6 +272,28 @@ nodemon.reset = function (done) {
|
||||
bus.emit('reset', done);
|
||||
};
|
||||
|
||||
bus.once('reset', () => {
|
||||
// FIXME only once a week
|
||||
if (utils.version.major < 6) {
|
||||
const Configstore = require('configstore');
|
||||
const pkg = require(__dirname + '/../package.json');
|
||||
const now = Date.now();
|
||||
|
||||
const week = 1000 * 60 * 60 * 24 * 7;
|
||||
const key = 'lastNodeWarning';
|
||||
|
||||
// create a Configstore instance with an unique ID e.g.
|
||||
// Package name and optionally some default values
|
||||
const conf = new Configstore(pkg.name);
|
||||
const last = conf.get(key);
|
||||
|
||||
if (!last || now - week > last) {
|
||||
utils.log.error(`WARNING: node@${process.version} is no longer maintained, nor supported by nodemon\nMore information: https://github.com/nodejs/Release#end-of-life-releases`);
|
||||
conf.set(key, now);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
bus.on('reset', function (done) {
|
||||
debug('reset');
|
||||
nodemon.removeAllListeners();
|
||||
|
||||
Reference in New Issue
Block a user