From 3ede3e39904519d536a1ef680f3f063899e5b950 Mon Sep 17 00:00:00 2001 From: geekan Date: Mon, 3 Jul 2023 11:23:00 +0800 Subject: [PATCH] fix setup of mmdc, check it later. --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ad0a101cb..1cdfa1169 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,10 @@ class InstallMermaidCLI(Command): user_options = [] def run(self): - subprocess.check_call(['npm', 'install', '-g', '@mermaid-js/mermaid-cli']) + try: + subprocess.check_call(['sudo', 'npm', 'install', '-g', '@mermaid-js/mermaid-cli']) + except subprocess.CalledProcessError as e: + print(f"Error occurred: {e.output}") here = path.abspath(path.dirname(__file__))