fix: add debug for npm exec in _pick_yarn_cmd
This commit is contained in:
1 parent
9cf14dc1d2
commit
eeeca44e4a
1 file changed
+10
-1
+10
-1
@@ -2006,13 +2006,22 @@ def _build_frontend(src_frontend: Path, dest_frontend: Path):
|
|||||||
# Use npm exec directly (bypasses broken corepack proxy)
|
# Use npm exec directly (bypasses broken corepack proxy)
|
||||||
if shutil.which("npm"):
|
if shutil.which("npm"):
|
||||||
try:
|
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", "--"])
|
major = _get_yarn_major_version(["npm", "exec", "--yes", "yarn@stable", "--"])
|
||||||
if major and major >= 4:
|
if major and major >= 4:
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
print(f" debug pick: using npm exec for yarn")
|
print(f" debug pick: using npm exec for yarn")
|
||||||
return ["npm", "exec", "--yes", "yarn@stable", "--"]
|
return ["npm", "exec", "--yes", "yarn@stable", "--"]
|
||||||
except Exception:
|
except Exception as e:
|
||||||
|
if DEBUG:
|
||||||
|
print(f" debug pick: npm exec failed: {e}")
|
||||||
pass
|
pass
|
||||||
|
return None
|
||||||
|
|
||||||
def _cleanup_yarn_artifacts():
|
def _cleanup_yarn_artifacts():
|
||||||
"""Remove corrupted yarn artifacts."""
|
"""Remove corrupted yarn artifacts."""
|
||||||
|
|||||||
Reference in new issue
Block a user