From eeeca44e4a1f345555d226588b6b686a7ceab7c9 Mon Sep 17 00:00:00 2001 From: Sergey Bahmatov Date: Mon, 5 Oct 2026 16:50:28 +0500 Subject: [PATCH] fix: add debug for npm exec in _pick_yarn_cmd --- npm_install.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/npm_install.py b/npm_install.py index fcf9781..853b764 100644 --- a/npm_install.py +++ b/npm_install.py @@ -2006,13 +2006,22 @@ def _build_frontend(src_frontend: Path, dest_frontend: Path): # Use npm exec directly (bypasses broken corepack proxy) if shutil.which("npm"): try: + result = subprocess.run( + ["npm", "exec", "--yes", "yarn@stable", "--", "--version"], + capture_output=True, text=True, timeout=30, + ) + if DEBUG: + print(f" debug pick: npm exec version={result.stdout.strip()} rc={result.returncode}") major = _get_yarn_major_version(["npm", "exec", "--yes", "yarn@stable", "--"]) if major and major >= 4: if DEBUG: print(f" debug pick: using npm exec for yarn") return ["npm", "exec", "--yes", "yarn@stable", "--"] - except Exception: + except Exception as e: + if DEBUG: + print(f" debug pick: npm exec failed: {e}") pass + return None def _cleanup_yarn_artifacts(): """Remove corrupted yarn artifacts."""