File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,15 +3,20 @@ import * as logger from './logger.js';
33import packageJson from '../../package.json' with { type : 'json' } ;
44
55const CLI_VERSION = packageJson . version ;
6+ const REQUIRED_NODE_VERSION = '22.12.0' ;
67
78function checkNode ( ) {
89 const nodeVersion = process . version ;
9- const version = nodeVersion . slice ( 1 ) ;
10+ const version = semver . coerce ( nodeVersion ) ;
1011
11- if ( semver . lt ( version , '22.12.0' ) ) {
12+ if ( version === null ) {
13+ logger . warn ( 'Unknown version of node detected.' ) ;
14+ return ;
15+ }
16+ if ( semver . lt ( version , REQUIRED_NODE_VERSION ) ) {
1217 logger . error (
13- `Markbind ${ CLI_VERSION } requires Node >=22.12.0 . `
14- + 'Please update Node or use an older version of MarkBind!'
18+ `Markbind ${ CLI_VERSION } requires node >=${ REQUIRED_NODE_VERSION } . `
19+ + 'Please update node or use an older version of Markbind!' ,
1520 ) ;
1621 process . exit ( 1 ) ;
1722 }
You can’t perform that action at this time.
0 commit comments