aboutsummaryrefslogtreecommitdiff
path: root/packages/bun-npm/src/install.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/bun-npm/src/install.ts')
-rw-r--r--packages/bun-npm/src/install.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/bun-npm/src/install.ts b/packages/bun-npm/src/install.ts
index fbf7a76bf..9eabd2c41 100644
--- a/packages/bun-npm/src/install.ts
+++ b/packages/bun-npm/src/install.ts
@@ -137,15 +137,23 @@ async function downloadBun(platform: Platform, dst: string): Promise<void> {
export function optimizeBun(path: string): void {
if (os === "win32") {
- return;
+ throw new Error(
+ "You must use Windows Subsystem for Linux, aka. WSL, to run bun. Learn more: https://learn.microsoft.com/en-us/windows/wsl/install",
+ );
}
const { npm_config_user_agent } = process.env;
if (npm_config_user_agent && /\byarn\//.test(npm_config_user_agent)) {
- return;
+ throw new Error(
+ "Yarn does not support bun, because it does not allow linking to binaries. To use bun, install using the following command: curl -fsSL https://bun.sh/install | bash",
+ );
}
try {
rename(path, join(__dirname, "bin", "bun"));
+ return;
} catch (error) {
console.debug("optimizeBun failed", error);
}
+ throw new Error(
+ "Your package manager doesn't seem to support bun. To use bun, install using the following command: curl -fsSL https://bun.sh/install | bash",
+ );
}