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."""