core: node版本需求降至node10.4

This commit is contained in:
undefined committed 2021-08-01 16:21:56 +08:00
1 parent 26a381ce3f
commit 289b4da1fe
3 files changed
+19 -5

No files matched your search

+6 -2
View File
@@ -1,6 +1,10 @@
const versionNum = +process.version.replace(/v/gim, '').split('.')[0];
if (versionNum < 14) throw new Error('NodeJS >=v14 required');
import cluster from 'cluster';
const versionNum = +process.version.replace(/v/gim, '').split('.')[0];
if (versionNum < 10) throw new Error('NodeJS >=10.4 required');
else if (versionNum < 14 && cluster.isMaster) {
console.warn('NodeJS version <14, startup performance will be impacted.');
}
if (!global.Hydro) {
global.Hydro = {
version: {