Syntax Error in Mermaid-cli tool
Breinich opened this issue · 1 comments
Breinich commented
Describe the bug
Failed to generate svg files for the mermaid diagrams because of an internal js syntax error, the response:
file:///usr/local/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:262
const svg = container.getElementsByTagName?.('svg')?.[0]
^
SyntaxError: Unexpected token '.'
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
To Reproduce
- Install the package with
npm install -g @mermaid-js/mermaid-cli
- Run the command:
mmdc -i Short.md -o Short_svg.md
Expected behavior
Generating an output md file and the according svg files
Screenshots
not applicable
Desktop (please complete the following information):
- OS: Ubuntu 22.04
- Browser: not browser, instead the mermaid-cli tool
Additional context
Add any other context about the problem here.
Breinich commented
Turns out I had an old version of Nodejs installed, so this was the root cause.