diff --git a/pynecone/config.py b/pynecone/config.py index c8a56bac3..d39e7848c 100644 --- a/pynecone/config.py +++ b/pynecone/config.py @@ -47,6 +47,9 @@ class Config(Base): # The path to the bun executable. bun_path: str = constants.BUN_PATH + # Disable bun. + disable_bun: bool = False + # Additional frontend packages to install. frontend_packages: List[str] = [] diff --git a/pynecone/utils/prerequisites.py b/pynecone/utils/prerequisites.py index 5d32f89a0..521aa52b5 100644 --- a/pynecone/utils/prerequisites.py +++ b/pynecone/utils/prerequisites.py @@ -72,6 +72,8 @@ def get_package_manager() -> str: Exit: If the app directory is invalid. """ + config = get_config() + # Check that the node version is valid. if not check_node_version(constants.MIN_NODE_VERSION): console.print( @@ -80,7 +82,7 @@ def get_package_manager() -> str: raise typer.Exit() # On Windows, we use npm instead of bun. - if platform.system() == "Windows": + if platform.system() == "Windows" or config.disable_bun: npm_path = path_ops.which("npm") if npm_path is None: raise FileNotFoundError("Pynecone requires npm to be installed on Windows.")