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 6226bf1Copy full SHA for 6226bf1
cli/common/bins.js
@@ -5,12 +5,28 @@
5
*/
6
7
const target = `${process.platform}-${process.arch}`;
8
+const binPackageName = `@rescript/${target}`;
9
+
10
+const supportedPlatforms = [
11
+ "darwin-arm64",
12
+ "darwin-x64",
13
+ "linux-arm64",
14
+ "linux-x64",
15
+ "win32-x64",
16
+];
17
18
/** @type {BinaryModuleExports} */
19
let mod;
-try {
- mod = await import(`@rescript/${target}`);
-} catch {
20
21
+if (supportedPlatforms.includes(target)) {
22
+ try {
23
+ mod = await import(binPackageName);
24
+ } catch {
25
+ throw new Error(
26
+ `Package ${binPackageName} not found. Make sure the rescript package is installed correctly.`,
27
+ );
28
+ }
29
+} else {
30
throw new Error(`Platform ${target} is not supported!`);
31
}
32
0 commit comments