From 6e1555ab843a543c67c4b51ef28caf7412649d6d Mon Sep 17 00:00:00 2001 From: Sergey Bahmatov Date: Mon, 5 Oct 2026 14:22:03 +0500 Subject: [PATCH] fix: clean global Yarn cache before frontend install Global /root/.yarn cache contains stale builtin patch references to _tsc.js that don't exist in typescript 7.0.2. Clean it before each yarn install attempt. --- npm_install.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/npm_install.py b/npm_install.py index 36ecb30..7103dcd 100644 --- a/npm_install.py +++ b/npm_install.py @@ -2320,6 +2320,13 @@ def _build_frontend(src_frontend: Path, dest_frontend: Path): shutil.rmtree(src_frontend / ".yarn", ignore_errors=True) shutil.rmtree(src_frontend / "node_modules", ignore_errors=True) + # Clean global Yarn 4.x cache with stale patch references + for g in [Path("/root/.yarn"), Path(os.path.expanduser("~/.config/yarn"))]: + if g.exists(): + if g.is_dir(): + shutil.rmtree(g, ignore_errors=True) + else: + g.unlink(missing_ok=True) run(yarn_cmd + ["cache", "clean", "--all"], check=False) custom_tmp = src_frontend / "tmp-build"