File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import Module from 'node:module'
22import path from 'node:path'
33import process from 'node:process'
44
5+ import { globSync } from 'tinyglobby'
6+
57import constants from '../constants'
68import { findBinPathDetailsSync , findNpmPathSync } from '../utils/path-resolve'
79
@@ -93,9 +95,14 @@ export function getNpmRequire(): NodeJS.Require {
9395let _arboristPkgPath : string | undefined
9496export 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}
You can’t perform that action at this time.
0 commit comments