1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

CLI: Detect installed Node version

This commit is contained in:
Laurent Cozic 2018-01-09 19:56:38 +00:00
parent e9268edeff
commit f67e4a03e4
3 changed files with 13 additions and 0 deletions

View File

@ -3,6 +3,13 @@
// Make it possible to require("/lib/...") without specifying full path // Make it possible to require("/lib/...") without specifying full path
require('app-module-path').addPath(__dirname); require('app-module-path').addPath(__dirname);
const compareVersion = require('compare-version');
const nodeVersion = process && process.versions && process.versions.node ? process.versions.node : '0.0.0';
if (compareVersion(nodeVersion, '8.0.0') < 0) {
console.error('Joplin requires Node 8+. Detected version ' + nodeVersion);
process.exit(1);
}
const { app } = require('./app.js'); const { app } = require('./app.js');
const Folder = require('lib/models/Folder.js'); const Folder = require('lib/models/Folder.js');
const Resource = require('lib/models/Resource.js'); const Resource = require('lib/models/Resource.js');

View File

@ -197,6 +197,11 @@
"delayed-stream": "1.0.0" "delayed-stream": "1.0.0"
} }
}, },
"compare-version": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/compare-version/-/compare-version-0.1.2.tgz",
"integrity": "sha1-AWLsLZNR9d3VmpICy6k1NmpyUIA="
},
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",

View File

@ -28,6 +28,7 @@
}, },
"dependencies": { "dependencies": {
"app-module-path": "^2.2.0", "app-module-path": "^2.2.0",
"compare-version": "^0.1.2",
"follow-redirects": "^1.2.4", "follow-redirects": "^1.2.4",
"form-data": "^2.1.4", "form-data": "^2.1.4",
"fs-extra": "^5.0.0", "fs-extra": "^5.0.0",