mirror of
https://github.com/MCSManager/MCSManager.git
synced 2025-04-06 17:10:29 +08:00
Node 版本检测
This commit is contained in:
parent
0501370f43
commit
f28c7bd31b
11
app.js
11
app.js
@ -1,3 +1,14 @@
|
||||
//运行时环境检测
|
||||
try {
|
||||
let versionNum = parseInt(process.version.replace(/v/igm, "").split(".")[0]);
|
||||
if (versionNum < 9) {
|
||||
console.log("[ ERROR ] 您的 Node 运行环境版本似乎低于我们要求的版本.");
|
||||
console.log("[ ERROR ] 可能会出现未知异常,请立即更新 Node 版本 (>=8.0.0)");
|
||||
}
|
||||
} catch (err) {
|
||||
//忽略任何版本检测导致的错误
|
||||
}
|
||||
|
||||
const express = require('express');
|
||||
const fs = require('fs');
|
||||
var session = require('express-session');
|
||||
|
Loading…
x
Reference in New Issue
Block a user