Skip to content

Commit 1497973

Browse files
committed
fixed build error.
1 parent 7f1e3f1 commit 1497973

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doctor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface CheckResult {
99
/** Check if Node.js version is >= 20 */
1010
async function checkNodeVersion(): Promise<CheckResult> {
1111
const version = process.version;
12-
const majorVersion = parseInt(version.slice(1).split('.')[0], 10);
12+
const majorVersion = parseInt(version.slice(1).split('.')[0] || '0', 10);
1313

1414
if (majorVersion >= 20) {
1515
return {
@@ -190,7 +190,7 @@ export async function runDoctor(autoFix: boolean = false): Promise<void> {
190190
console.log('⚠️ Some requirements are not satisfied.\n');
191191

192192
// Check if Node.js version failed
193-
if (!results[0].passed) {
193+
if (!nodeResult.passed) {
194194
console.log('📌 Node.js must be manually installed or updated.');
195195
console.log(' Download from: https://nodejs.org/ (LTS version recommended)\n');
196196
}

0 commit comments

Comments
 (0)