Document supported node version

This commit is contained in:
Pavel Djundik 2016-04-26 13:51:11 +03:00
parent 21fb0e0709
commit d428bb7511
3 changed files with 19 additions and 3 deletions

View File

@ -35,6 +35,12 @@ the review process quicker and more streamlined.
## Install
To use The Lounge you must have [Node.js](https://nodejs.org/en/download/) installed.
The oldest Node.js version we support is 4.2.0.
If you still use 0.10 or 0.12 we strongly advise you to upgrade before installing The Lounge.
For more information on how to upgrade, read the [documentation](https://nodejs.org/en/download/package-manager/).
```
sudo npm install -g thelounge
```

View File

@ -26,6 +26,9 @@
"server"
],
"license": "MIT",
"engines": {
"node": ">=4.2.0"
},
"dependencies": {
"bcrypt-nodejs": "0.0.3",
"cheerio": "0.20.0",
@ -39,6 +42,7 @@
"moment": "2.13.0",
"read": "1.0.7",
"request": "2.72.0",
"semver": "5.1.0",
"socket.io": "1.4.5",
"spdy": "3.3.2"
},

View File

@ -1,4 +1,5 @@
var _ = require("lodash");
var package = require("../package.json");
var bcrypt = require("bcrypt-nodejs");
var Client = require("./client");
var ClientManager = require("./clientManager");
@ -56,8 +57,13 @@ module.exports = function(options) {
manager.sockets = sockets;
log.info("The Lounge is now running on", protocol + "://" + config.host + ":" + config.port + "/");
log.info("Press ctrl-c to stop");
log.info("The Lounge v" + package.version + " is now running on", protocol + "://" + config.host + ":" + config.port + "/");
log.info("Press ctrl-c to stop\n");
if (!require("semver").satisfies(process.version, package.engines.node)) {
log.warn("The oldest supported Node.js version is ", package.engines.node);
log.warn("We strongly encourage you to upgrade, see https://nodejs.org/en/download/package-manager/ for more details\n");
}
if (!config.public) {
manager.loadUsers();
@ -71,7 +77,7 @@ function index(req, res, next) {
if (req.url.split("?")[0] !== "/") return next();
return fs.readFile("client/index.html", "utf-8", function(err, file) {
var data = _.merge(
require("../package.json"),
package,
config
);
var template = _.template(file);