liaoch commited on
Commit
a1918b7
·
1 Parent(s): 040f927

Fix: Pin @mermaid-js/mermaid-cli to version 9.1.0 to ensure --args support

Browse files
Files changed (1) hide show
  1. mermaid_renderer.py +3 -2
mermaid_renderer.py CHANGED
@@ -39,9 +39,10 @@ class MermaidRenderer:
39
  # Attempt installation if not found (consider security implications)
40
  try:
41
  # Using '--unsafe-perm' might be needed in some environments, but use with caution.
42
- install_cmd = ["npm", "install", "-g", "@mermaid-js/mermaid-cli"]
 
43
  subprocess.run(install_cmd, check=True, capture_output=True, text=True)
44
- logging.info("@mermaid-js/mermaid-cli installed successfully via npm.")
45
  except subprocess.SubprocessError as install_error:
46
  logging.error(f"Failed to install @mermaid-js/mermaid-cli: {install_error.stderr}")
47
  raise RuntimeError("Error: @mermaid-js/mermaid-cli (mmdc) is not installed and automatic installation failed. Please install manually: npm install -g @mermaid-js/mermaid-cli")
 
39
  # Attempt installation if not found (consider security implications)
40
  try:
41
  # Using '--unsafe-perm' might be needed in some environments, but use with caution.
42
+ # Pinning to a specific version that supports --args
43
+ install_cmd = ["npm", "install", "-g", "@mermaid-js/[email protected]"]
44
  subprocess.run(install_cmd, check=True, capture_output=True, text=True)
45
+ logging.info("@mermaid-js/mermaid-cli@9.1.0 installed successfully via npm.")
46
  except subprocess.SubprocessError as install_error:
47
  logging.error(f"Failed to install @mermaid-js/mermaid-cli: {install_error.stderr}")
48
  raise RuntimeError("Error: @mermaid-js/mermaid-cli (mmdc) is not installed and automatic installation failed. Please install manually: npm install -g @mermaid-js/mermaid-cli")