Skip to content

Commit

Permalink
fix: global installation detect (#1566)
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX authored May 2, 2024
1 parent 9699086 commit f796d59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/slidev/node/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export async function getRoots(entry?: string): Promise<RootsInfo> {
throw new Error('[slidev] Cannot find roots without entry')
const userRoot = dirname(entry)
isInstalledGlobally.value
= !/^(\.\.\/)*node_modules\//i.test(slash(relative(userRoot, cliRoot)))
= slash(relative(userRoot, process.argv[1])).includes('/.pnpm/')
|| (await import('is-installed-globally')).default
const clientRoot = await findPkgRoot('@slidev/client', cliRoot, true)
const closestPkgRoot = dirname(await findClosestPkgJsonPath(userRoot) || userRoot)
Expand Down

0 comments on commit f796d59

Please sign in to comment.