Skip to content

Commit 42e647a

Browse files
committed
fix: Failing install script
1 parent 1a2a244 commit 42e647a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

scripts/check-build.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import fs from 'fs';
2-
import child_process from 'child_process';
1+
import * as child_process from 'node:child_process';
2+
import * as fs from 'node:fs';
3+
import { createRequire } from 'node:module';
34
import * as binaries from './binaries.mjs';
45

6+
const require = createRequire(import.meta.url);
7+
58
function clean(err) {
69
return err.toString().trim();
710
}
@@ -32,7 +35,7 @@ function recompileFromSource() {
3235

3336
if (fs.existsSync(binaries.target)) {
3437
try {
35-
await import(binaries.target);
38+
require(binaries.target);
3639
console.log('Precompiled binary found, skipping build from source.');
3740
} catch (e) {
3841
console.log('Precompiled binary found but failed loading');

0 commit comments

Comments
 (0)