@@ -54,7 +54,14 @@ readPackages(clientPackages);
54
54
checkVersions ( ) ;
55
55
56
56
for ( 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 ) ;
58
65
const { dependencies = { } , devDependencies = { } } = pkgJson ;
59
66
60
67
for ( const [ name , version ] of Object . entries ( dependencies ) ) {
@@ -115,7 +122,7 @@ for (const pkg of nonClientPackages) {
115
122
}
116
123
}
117
124
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" ) ;
119
126
}
120
127
121
128
readPackages ( nonClientPackages ) ;
@@ -147,7 +154,14 @@ function checkVersions() {
147
154
148
155
function readPackages ( packages ) {
149
156
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 ) ;
151
165
const { dependencies = { } , devDependencies = { } } = pkgJson ;
152
166
for ( const [ name , version ] of Object . entries ( dependencies ) ) {
153
167
if ( version . startsWith ( "file:" ) ) {
0 commit comments