Skip to content

Commit 8b05281

Browse files
committed
fix: wrap binary path resolution with fileURLToPath
1 parent 47d5dd3 commit 8b05281

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

shared/src/findBinary.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as fs from "fs";
22
import * as fsAsync from "fs/promises";
33
import * as path from "path";
44
import * as semver from "semver";
5+
import * as url from "url";
56

67
export type BinaryName =
78
| "bsc.exe"
@@ -115,7 +116,7 @@ export const findBinary = async ({
115116
"..",
116117
`@rescript/${target}/bin.js`,
117118
);
118-
const { binPaths } = await import(targetPackagePath);
119+
const { binPaths } = await import(url.fileURLToPath(targetPackagePath));
119120

120121
if (binary === "bsc.exe") {
121122
binaryPath = binPaths.bsc_exe;

0 commit comments

Comments
 (0)