From 1a833d6b25effdcdbcca5c9b64d31088a7e1784e Mon Sep 17 00:00:00 2001 From: Elijah Ahianyo Date: Thu, 30 May 2024 15:57:15 -0700 Subject: [PATCH] Recommend Running with `REFLEX_USE_NPM=1` if npm run fails after installing packages with bun. (#3399) --- reflex/constants/installer.py | 2 +- reflex/utils/exec.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index 9ee68d345e..6fa0d2e300 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -35,7 +35,7 @@ class Bun(SimpleNamespace): """Bun constants.""" # The Bun version. - VERSION = "1.1.8" + VERSION = "1.1.10" # Min Bun Version MIN_VERSION = "0.7.0" # The directory to store the bun. diff --git a/reflex/utils/exec.py b/reflex/utils/exec.py index 91f235b7ec..3af5b80341 100644 --- a/reflex/utils/exec.py +++ b/reflex/utils/exec.py @@ -113,6 +113,14 @@ def run_process_and_launch_url(run_command: list[str], backend_present=True): else: console.print("New packages detected: Updating app...") else: + if any( + [x in line for x in ("bin executable does not exist on disk",)] + ): + console.error( + "Try setting `REFLEX_USE_NPM=1` and re-running `reflex init` and `reflex run` to use npm instead of bun:\n" + "`REFLEX_USE_NPM=1 reflex init`\n" + "`REFLEX_USE_NPM=1 reflex run`" + ) new_hash = detect_package_change(json_file_path) if new_hash != last_hash: last_hash = new_hash