Skip to content

Commit 5c5a86c

Browse files
committed
Changed directory where npm get prefix is called from.
1 parent d1c8bf7 commit 5c5a86c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/doxdox-cli/src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22

3-
import { EOL } from 'os';
3+
import { EOL, homedir } from 'os';
44

55
import { promises as fs } from 'fs';
66

@@ -118,7 +118,10 @@ const overridePackage = String(
118118
);
119119

120120
const globalNodeModulesDir = resolve(
121-
join(execSync('npm get prefix').toString().trim(), './lib/node_modules')
121+
join(
122+
execSync('npm get prefix', { cwd: homedir() }).toString().trim(),
123+
'./lib/node_modules'
124+
)
122125
);
123126

124127
if (!localNodeModulesDir || !globalNodeModulesDir) {

0 commit comments

Comments
 (0)