Skip to content

Commit 6e93b54

Browse files
committed
debug
1 parent 7e3c8c4 commit 6e93b54

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/shadow/npm-paths.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import Module from 'node:module'
22
import path from 'node:path'
33
import process from 'node:process'
44

5+
import { globSync } from 'tinyglobby'
6+
57
import constants from '../constants'
68
import { findBinPathDetailsSync, findNpmPathSync } from '../utils/path-resolve'
79

@@ -93,9 +95,14 @@ export function getNpmRequire(): NodeJS.Require {
9395
let _arboristPkgPath: string | undefined
9496
export function getArboristPackagePath() {
9597
if (_arboristPkgPath === undefined) {
98+
try {
9699
const pkgName = '@npmcli/arborist'
97100
const mainPath = getNpmRequire().resolve(pkgName)
98101
_arboristPkgPath = mainPath.slice(0, mainPath.indexOf(pkgName) + pkgName.length)
102+
} catch {
103+
console.error(globSync(['node_modules/**'], { cwd: getNpmPath() }))
104+
throw new Error()
105+
}
99106
}
100107
return _arboristPkgPath
101108
}

0 commit comments

Comments
 (0)