@@ -54,7 +54,14 @@ readPackages(clientPackages);
5454checkVersions ( ) ;
5555
5656for ( const pkg of nonClientPackages ) {
57- const pkgJson = require ( path . join ( pkg , "package.json" ) ) ;
57+ const pkgJsonPath = path . join ( pkg , "package.json" ) ;
58+
59+ // Check if package.json exists before requiring it
60+ if ( ! fs . existsSync ( pkgJsonPath ) ) {
61+ continue ;
62+ }
63+
64+ const pkgJson = require ( pkgJsonPath ) ;
5865 const { dependencies = { } , devDependencies = { } } = pkgJson ;
5966
6067 for ( const [ name , version ] of Object . entries ( dependencies ) ) {
@@ -115,7 +122,7 @@ for (const pkg of nonClientPackages) {
115122 }
116123 }
117124
118- fs . writeFileSync ( path . join ( pkg , "package.json" ) , JSON . stringify ( pkgJson , null , 2 ) + "\n" , "utf-8" ) ;
125+ fs . writeFileSync ( pkgJsonPath , JSON . stringify ( pkgJson , null , 2 ) + "\n" , "utf-8" ) ;
119126}
120127
121128readPackages ( nonClientPackages ) ;
@@ -147,7 +154,14 @@ function checkVersions() {
147154
148155function readPackages ( packages ) {
149156 for ( const pkg of packages ) {
150- const pkgJson = require ( path . join ( pkg , "package.json" ) ) ;
157+ const pkgJsonPath = path . join ( pkg , "package.json" ) ;
158+
159+ // Check if package.json exists before requiring it
160+ if ( ! fs . existsSync ( pkgJsonPath ) ) {
161+ continue ;
162+ }
163+
164+ const pkgJson = require ( pkgJsonPath ) ;
151165 const { dependencies = { } , devDependencies = { } } = pkgJson ;
152166 for ( const [ name , version ] of Object . entries ( dependencies ) ) {
153167 if ( version . startsWith ( "file:" ) ) {
0 commit comments