Skip to content

Commit d4f2a83

Browse files
committed
fix: detecting nuxi
1 parent 5760549 commit d4f2a83

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils/nuxt.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,14 @@ export function parseTsconfigPaths(tsconfigPaths: TsconfigPaths): {} {
287287

288288
export function isNuxiInstalled(): Promise<boolean> {
289289
return new Promise((resolve) => {
290-
exec('npm ls -g --depth=0', (error, stdout, stderr) => {
290+
exec('nuxi --version', (error, stdout) => {
291291
if (error) {
292292
console.error(`Error: ${error}`);
293293
resolve(false);
294294
} else {
295-
resolve(stdout.includes('nuxi'));
295+
console.log(`stdout: ${stdout}`);
296+
const versionPattern = /^\s*\d+\.\d+\.\d+\s*$/;
297+
resolve(versionPattern.test(stdout.toString()));
296298
}
297299
});
298300
});

0 commit comments

Comments
 (0)