We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76f9e00 commit a7f9a8eCopy full SHA for a7f9a8e
cli/common/bins.js
@@ -6,11 +6,28 @@
6
7
const target = `${process.platform}-${process.arch}`;
8
9
+const supportedPlatforms = [
10
+ "darwin-arm64",
11
+ "darwin-x64",
12
+ "linux-arm64",
13
+ "linux-x64",
14
+ "win32-x64",
15
+];
16
+
17
/** @type {BinaryModuleExports} */
18
let mod;
-try {
- mod = await import(`@rescript/${target}`);
-} catch {
19
20
+if (supportedPlatforms.includes(target)) {
21
+ const binPackageName = `@rescript/${target}`;
22
23
+ try {
24
+ mod = await import(binPackageName);
25
+ } catch {
26
+ throw new Error(
27
+ `Package ${binPackageName} not found. Make sure the rescript package is installed correctly.`,
28
+ );
29
+ }
30
+} else {
31
throw new Error(`Platform ${target} is not supported!`);
32
}
33
0 commit comments