Skip to content

Commit e1d282a

Browse files
authored
feat: warn and exit on unsupported node version
1 parent fd00272 commit e1d282a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

server/index.js

+13
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@
66
const path = require('path')
77
const { nanoid } = require('nanoid')
88
const { DateTime } = require('luxon')
9+
const { gte } = require('semver')
10+
11+
// ----------------------------------------
12+
// Check Node.js version
13+
// ----------------------------------------
14+
if (gte(process.version, '18.0.0')) {
15+
console.error('You\'re using an unsupported Node.js version. Please read the requirements.')
16+
process.exit(1)
17+
}
18+
19+
// ----------------------------------------
20+
// Init WIKI instance
21+
// ----------------------------------------
922

1023
let WIKI = {
1124
IS_DEBUG: process.env.NODE_ENV === 'development',

0 commit comments

Comments
 (0)