File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -32,14 +32,22 @@ export function logSystemInfo() {
32
32
* @internal
33
33
*/
34
34
export function checkCrawleeVersion ( ) {
35
+ const resolve = ( name : string ) => {
36
+ try {
37
+ return require . resolve ( name ) ;
38
+ } catch {
39
+ return name ;
40
+ }
41
+ } ;
42
+
35
43
const paths = [
36
44
// when users install `crawlee` package, we need to check its core dependency
37
45
normalize ( `${ process . cwd ( ) } /node_modules/crawlee/node_modules/@crawlee/core/package.json` ) ,
38
46
// when users install `@crawlee/cheerio` or other crawler package, we need to check the dependency under basic crawler package
39
47
normalize ( `${ process . cwd ( ) } /node_modules/@crawlee/basic/node_modules/@crawlee/core/package.json` ) ,
40
48
// also check paths via `require.resolve` to support pnpm
41
- require . resolve ( 'crawlee/package.json' ) ,
42
- require . resolve ( '@crawlee/basic/package.json' ) ,
49
+ resolve ( 'crawlee/package.json' ) ,
50
+ resolve ( '@crawlee/basic/package.json' ) ,
43
51
] ;
44
52
45
53
for ( const path of paths ) {
You can’t perform that action at this time.
0 commit comments