Skip to content

Commit 5e3f10d

Browse files
committed
fix: don't panic if cannot find the Node version
1 parent fbfe666 commit 5e3f10d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/api.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,7 @@ async function createChildVitestProcess(pkg: VitestPackage) {
261261
const env = getConfig().env || {}
262262
const execPath = await findNode(vscode.workspace.workspaceFile?.fsPath || pkg.cwd)
263263
const execVersion = await getNodeJsVersion(execPath)
264-
if (!execVersion) {
265-
log.error('[API]', `Failed to get Node.js version from ${execPath}`)
266-
throw new Error('Failed to get Node.js version')
267-
}
268-
if (!gte(execVersion, minimumNodeVersion)) {
264+
if (execVersion && !gte(execVersion, minimumNodeVersion)) {
269265
const errorMsg = `Node.js version ${execVersion} is not supported. Minimum required version is ${minimumNodeVersion}`
270266
log.error('[API]', errorMsg)
271267
throw new Error(errorMsg)

0 commit comments

Comments
 (0)