From 7e082805398d1abfefd28563c3ee8212dcba56f8 Mon Sep 17 00:00:00 2001 From: Sergey Bahmatov Date: Mon, 5 Oct 2026 14:35:58 +0500 Subject: [PATCH] fix: fix corepack install command (remove bad input/stdin) --- npm_install.py | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/npm_install.py b/npm_install.py index e3e554b..d51e070 100644 --- a/npm_install.py +++ b/npm_install.py @@ -2172,37 +2172,33 @@ def _build_frontend(src_frontend: Path, dest_frontend: Path): if shutil.which("corepack"): try: # Enable corepack - result = subprocess.run( + subprocess.run( ["corepack", "enable"], - input="", - stdin=subprocess.PIPE, capture_output=True, timeout=10, + check=False, + ) + + # Install Yarn stable (4.x) + result = subprocess.run( + ["corepack", "install", "-g", "yarn@stable"], + capture_output=True, + timeout=60, text=True, check=False, ) - if result.returncode == 0 or "already" in (result.stderr or "").lower(): - # Install Yarn stable (4.x) - result = subprocess.run( - ["corepack", "install", "-g", "yarn@stable"], + if result.returncode == 0: + # Activate it + subprocess.run( + ["corepack", "prepare", "yarn@stable", "--activate"], capture_output=True, - timeout=60, - text=True, + timeout=30, check=False, ) - if result.returncode == 0: - # Activate it - subprocess.run( - ["corepack", "prepare", "yarn@stable", "--activate"], - capture_output=True, - timeout=30, - check=False, - ) - - # Check version - if shutil.which("yarn"): + # Check version + if shutil.which("yarn"): major = _get_yarn_major_version(["yarn"]) if major and major >= 4: