chore: 增加 node 版本非 18 时的提示

This commit is contained in:
Clansty 2024-01-28 14:11:38 +08:00
parent b64c6f7a4d
commit c0cadee504
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
1 changed files with 5 additions and 0 deletions

View File

@ -12,6 +12,11 @@ import db from './models/db';
},
});
const log = getLogger('Main');
if (!process.versions.node.startsWith('18.')) {
log.warn('当前正在使用的 Node.JS 版本为', process.versions.node, ',未经测试');
}
process.on('unhandledRejection', error => {
log.error('UnhandledException: ', error);
});