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() {
3232 * @internal
3333 */
3434export function checkCrawleeVersion ( ) {
35+ const resolve = ( name : string ) => {
36+ try {
37+ return require . resolve ( name ) ;
38+ } catch {
39+ return name ;
40+ }
41+ } ;
42+
3543 const paths = [
3644 // when users install `crawlee` package, we need to check its core dependency
3745 normalize ( `${ process . cwd ( ) } /node_modules/crawlee/node_modules/@crawlee/core/package.json` ) ,
3846 // when users install `@crawlee/cheerio` or other crawler package, we need to check the dependency under basic crawler package
3947 normalize ( `${ process . cwd ( ) } /node_modules/@crawlee/basic/node_modules/@crawlee/core/package.json` ) ,
4048 // 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' ) ,
4351 ] ;
4452
4553 for ( const path of paths ) {
You can’t perform that action at this time.
0 commit comments