@@ -78,7 +78,12 @@ function requireNative() {
78
78
loadErrors . push ( e )
79
79
}
80
80
try {
81
- return require ( '@oxc-resolver/binding-android-arm64' )
81
+ const binding = require ( '@oxc-resolver/binding-android-arm64' )
82
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-android-arm64/package.json' ) . version
83
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
84
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
85
+ }
86
+ return binding
82
87
} catch ( e ) {
83
88
loadErrors . push ( e )
84
89
}
@@ -89,7 +94,12 @@ function requireNative() {
89
94
loadErrors . push ( e )
90
95
}
91
96
try {
92
- return require ( '@oxc-resolver/binding-android-arm-eabi' )
97
+ const binding = require ( '@oxc-resolver/binding-android-arm-eabi' )
98
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-android-arm-eabi/package.json' ) . version
99
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
100
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
101
+ }
102
+ return binding
93
103
} catch ( e ) {
94
104
loadErrors . push ( e )
95
105
}
@@ -104,7 +114,12 @@ function requireNative() {
104
114
loadErrors . push ( e )
105
115
}
106
116
try {
107
- return require ( '@oxc-resolver/binding-win32-x64-msvc' )
117
+ const binding = require ( '@oxc-resolver/binding-win32-x64-msvc' )
118
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-win32-x64-msvc/package.json' ) . version
119
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
120
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
121
+ }
122
+ return binding
108
123
} catch ( e ) {
109
124
loadErrors . push ( e )
110
125
}
@@ -115,7 +130,12 @@ function requireNative() {
115
130
loadErrors . push ( e )
116
131
}
117
132
try {
118
- return require ( '@oxc-resolver/binding-win32-ia32-msvc' )
133
+ const binding = require ( '@oxc-resolver/binding-win32-ia32-msvc' )
134
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-win32-ia32-msvc/package.json' ) . version
135
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
136
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
137
+ }
138
+ return binding
119
139
} catch ( e ) {
120
140
loadErrors . push ( e )
121
141
}
@@ -126,7 +146,12 @@ function requireNative() {
126
146
loadErrors . push ( e )
127
147
}
128
148
try {
129
- return require ( '@oxc-resolver/binding-win32-arm64-msvc' )
149
+ const binding = require ( '@oxc-resolver/binding-win32-arm64-msvc' )
150
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-win32-arm64-msvc/package.json' ) . version
151
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
152
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
153
+ }
154
+ return binding
130
155
} catch ( e ) {
131
156
loadErrors . push ( e )
132
157
}
@@ -140,7 +165,12 @@ function requireNative() {
140
165
loadErrors . push ( e )
141
166
}
142
167
try {
143
- return require ( '@oxc-resolver/binding-darwin-universal' )
168
+ const binding = require ( '@oxc-resolver/binding-darwin-universal' )
169
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-darwin-universal/package.json' ) . version
170
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
171
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
172
+ }
173
+ return binding
144
174
} catch ( e ) {
145
175
loadErrors . push ( e )
146
176
}
@@ -151,7 +181,12 @@ function requireNative() {
151
181
loadErrors . push ( e )
152
182
}
153
183
try {
154
- return require ( '@oxc-resolver/binding-darwin-x64' )
184
+ const binding = require ( '@oxc-resolver/binding-darwin-x64' )
185
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-darwin-x64/package.json' ) . version
186
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
187
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
188
+ }
189
+ return binding
155
190
} catch ( e ) {
156
191
loadErrors . push ( e )
157
192
}
@@ -162,7 +197,12 @@ function requireNative() {
162
197
loadErrors . push ( e )
163
198
}
164
199
try {
165
- return require ( '@oxc-resolver/binding-darwin-arm64' )
200
+ const binding = require ( '@oxc-resolver/binding-darwin-arm64' )
201
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-darwin-arm64/package.json' ) . version
202
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
203
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
204
+ }
205
+ return binding
166
206
} catch ( e ) {
167
207
loadErrors . push ( e )
168
208
}
@@ -177,7 +217,12 @@ function requireNative() {
177
217
loadErrors . push ( e )
178
218
}
179
219
try {
180
- return require ( '@oxc-resolver/binding-freebsd-x64' )
220
+ const binding = require ( '@oxc-resolver/binding-freebsd-x64' )
221
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-freebsd-x64/package.json' ) . version
222
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
223
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
224
+ }
225
+ return binding
181
226
} catch ( e ) {
182
227
loadErrors . push ( e )
183
228
}
@@ -188,7 +233,12 @@ function requireNative() {
188
233
loadErrors . push ( e )
189
234
}
190
235
try {
191
- return require ( '@oxc-resolver/binding-freebsd-arm64' )
236
+ const binding = require ( '@oxc-resolver/binding-freebsd-arm64' )
237
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-freebsd-arm64/package.json' ) . version
238
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
239
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
240
+ }
241
+ return binding
192
242
} catch ( e ) {
193
243
loadErrors . push ( e )
194
244
}
@@ -204,7 +254,12 @@ function requireNative() {
204
254
loadErrors . push ( e )
205
255
}
206
256
try {
207
- return require ( '@oxc-resolver/binding-linux-x64-musl' )
257
+ const binding = require ( '@oxc-resolver/binding-linux-x64-musl' )
258
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-linux-x64-musl/package.json' ) . version
259
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
260
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
261
+ }
262
+ return binding
208
263
} catch ( e ) {
209
264
loadErrors . push ( e )
210
265
}
@@ -215,7 +270,12 @@ function requireNative() {
215
270
loadErrors . push ( e )
216
271
}
217
272
try {
218
- return require ( '@oxc-resolver/binding-linux-x64-gnu' )
273
+ const binding = require ( '@oxc-resolver/binding-linux-x64-gnu' )
274
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-linux-x64-gnu/package.json' ) . version
275
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
276
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
277
+ }
278
+ return binding
219
279
} catch ( e ) {
220
280
loadErrors . push ( e )
221
281
}
@@ -228,7 +288,12 @@ function requireNative() {
228
288
loadErrors . push ( e )
229
289
}
230
290
try {
231
- return require ( '@oxc-resolver/binding-linux-arm64-musl' )
291
+ const binding = require ( '@oxc-resolver/binding-linux-arm64-musl' )
292
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-linux-arm64-musl/package.json' ) . version
293
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
294
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
295
+ }
296
+ return binding
232
297
} catch ( e ) {
233
298
loadErrors . push ( e )
234
299
}
@@ -239,7 +304,12 @@ function requireNative() {
239
304
loadErrors . push ( e )
240
305
}
241
306
try {
242
- return require ( '@oxc-resolver/binding-linux-arm64-gnu' )
307
+ const binding = require ( '@oxc-resolver/binding-linux-arm64-gnu' )
308
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-linux-arm64-gnu/package.json' ) . version
309
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
310
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
311
+ }
312
+ return binding
243
313
} catch ( e ) {
244
314
loadErrors . push ( e )
245
315
}
@@ -252,7 +322,12 @@ function requireNative() {
252
322
loadErrors . push ( e )
253
323
}
254
324
try {
255
- return require ( '@oxc-resolver/binding-linux-arm-musleabihf' )
325
+ const binding = require ( '@oxc-resolver/binding-linux-arm-musleabihf' )
326
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-linux-arm-musleabihf/package.json' ) . version
327
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
328
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
329
+ }
330
+ return binding
256
331
} catch ( e ) {
257
332
loadErrors . push ( e )
258
333
}
@@ -263,7 +338,12 @@ function requireNative() {
263
338
loadErrors . push ( e )
264
339
}
265
340
try {
266
- return require ( '@oxc-resolver/binding-linux-arm-gnueabihf' )
341
+ const binding = require ( '@oxc-resolver/binding-linux-arm-gnueabihf' )
342
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-linux-arm-gnueabihf/package.json' ) . version
343
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
344
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
345
+ }
346
+ return binding
267
347
} catch ( e ) {
268
348
loadErrors . push ( e )
269
349
}
@@ -276,7 +356,12 @@ function requireNative() {
276
356
loadErrors . push ( e )
277
357
}
278
358
try {
279
- return require ( '@oxc-resolver/binding-linux-riscv64-musl' )
359
+ const binding = require ( '@oxc-resolver/binding-linux-riscv64-musl' )
360
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-linux-riscv64-musl/package.json' ) . version
361
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
362
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
363
+ }
364
+ return binding
280
365
} catch ( e ) {
281
366
loadErrors . push ( e )
282
367
}
@@ -287,7 +372,12 @@ function requireNative() {
287
372
loadErrors . push ( e )
288
373
}
289
374
try {
290
- return require ( '@oxc-resolver/binding-linux-riscv64-gnu' )
375
+ const binding = require ( '@oxc-resolver/binding-linux-riscv64-gnu' )
376
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-linux-riscv64-gnu/package.json' ) . version
377
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
378
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
379
+ }
380
+ return binding
291
381
} catch ( e ) {
292
382
loadErrors . push ( e )
293
383
}
@@ -299,7 +389,12 @@ function requireNative() {
299
389
loadErrors . push ( e )
300
390
}
301
391
try {
302
- return require ( '@oxc-resolver/binding-linux-ppc64-gnu' )
392
+ const binding = require ( '@oxc-resolver/binding-linux-ppc64-gnu' )
393
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-linux-ppc64-gnu/package.json' ) . version
394
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
395
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
396
+ }
397
+ return binding
303
398
} catch ( e ) {
304
399
loadErrors . push ( e )
305
400
}
@@ -310,7 +405,12 @@ function requireNative() {
310
405
loadErrors . push ( e )
311
406
}
312
407
try {
313
- return require ( '@oxc-resolver/binding-linux-s390x-gnu' )
408
+ const binding = require ( '@oxc-resolver/binding-linux-s390x-gnu' )
409
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-linux-s390x-gnu/package.json' ) . version
410
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
411
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
412
+ }
413
+ return binding
314
414
} catch ( e ) {
315
415
loadErrors . push ( e )
316
416
}
@@ -320,34 +420,49 @@ function requireNative() {
320
420
} else if ( process . platform === 'openharmony' ) {
321
421
if ( process . arch === 'arm64' ) {
322
422
try {
323
- return require ( './resolver.linux -arm64-ohos .node' )
423
+ return require ( './resolver.openharmony -arm64.node' )
324
424
} catch ( e ) {
325
425
loadErrors . push ( e )
326
426
}
327
427
try {
328
- return require ( '@oxc-resolver/binding-linux-arm64-ohos' )
428
+ const binding = require ( '@oxc-resolver/binding-openharmony-arm64' )
429
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-openharmony-arm64/package.json' ) . version
430
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
431
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
432
+ }
433
+ return binding
329
434
} catch ( e ) {
330
435
loadErrors . push ( e )
331
436
}
332
437
} else if ( process . arch === 'x64' ) {
333
438
try {
334
- return require ( './resolver.linux -x64-ohos .node' )
439
+ return require ( './resolver.openharmony -x64.node' )
335
440
} catch ( e ) {
336
441
loadErrors . push ( e )
337
442
}
338
443
try {
339
- return require ( '@oxc-resolver/binding-linux-x64-ohos' )
444
+ const binding = require ( '@oxc-resolver/binding-openharmony-x64' )
445
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-openharmony-x64/package.json' ) . version
446
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
447
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
448
+ }
449
+ return binding
340
450
} catch ( e ) {
341
451
loadErrors . push ( e )
342
452
}
343
453
} else if ( process . arch === 'arm' ) {
344
454
try {
345
- return require ( './resolver.linux -arm-ohos .node' )
455
+ return require ( './resolver.openharmony -arm.node' )
346
456
} catch ( e ) {
347
457
loadErrors . push ( e )
348
458
}
349
459
try {
350
- return require ( '@oxc-resolver/binding-linux-arm-ohos' )
460
+ const binding = require ( '@oxc-resolver/binding-openharmony-arm' )
461
+ const bindingPackageVersion = require ( '@oxc-resolver/binding-openharmony-arm/package.json' ) . version
462
+ if ( bindingPackageVersion !== '11.6.1' && process . env . NAPI_RS_ENFORCE_VERSION_CHECK && process . env . NAPI_RS_ENFORCE_VERSION_CHECK !== '0' ) {
463
+ throw new Error ( `Native binding package version mismatch, expected 11.6.1 but got ${ bindingPackageVersion } . You can reinstall dependencies to fix this issue.` )
464
+ }
465
+ return binding
351
466
} catch ( e ) {
352
467
loadErrors . push ( e )
353
468
}
0 commit comments