Skip to content

Commit

Permalink
fix: don't panic if cannot find the Node version
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Jun 12, 2024
1 parent fbfe666 commit 5e3f10d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,7 @@ async function createChildVitestProcess(pkg: VitestPackage) {
const env = getConfig().env || {}
const execPath = await findNode(vscode.workspace.workspaceFile?.fsPath || pkg.cwd)
const execVersion = await getNodeJsVersion(execPath)
if (!execVersion) {
log.error('[API]', `Failed to get Node.js version from ${execPath}`)
throw new Error('Failed to get Node.js version')
}
if (!gte(execVersion, minimumNodeVersion)) {
if (execVersion && !gte(execVersion, minimumNodeVersion)) {
const errorMsg = `Node.js version ${execVersion} is not supported. Minimum required version is ${minimumNodeVersion}`
log.error('[API]', errorMsg)
throw new Error(errorMsg)
Expand Down

0 comments on commit 5e3f10d

Please sign in to comment.