diff --git a/src/pure/isVitestEnv.ts b/src/pure/isVitestEnv.ts index 46c5529c..e684b582 100644 --- a/src/pure/isVitestEnv.ts +++ b/src/pure/isVitestEnv.ts @@ -11,6 +11,9 @@ export async function isVitestEnv(projectRoot: string | WorkspaceFolder): Promis if (getVitestPath(projectRoot)) return true + if (!existsSync(path.join(projectRoot, 'package.json'))) + return false + const pkgPath = path.join(projectRoot, 'package.json') as string const pkg = JSON.parse(await readFile(pkgPath, 'utf-8')) as any if (existsSync(pkg)) {