Closed EricBuist closed 1 year ago
Thank you for reporting the problem. Can you tell us which version of mermaid-cli you have installed and gives you the error? The newest version is 9.1.7. Also a docker version of mermaid-cli is available. And it works fine. Another thing, can you attach your mermaid diagram file? We have a test for similar scenario and I cannot see how our test is different from what you try to do.
This is version 9.1.7. I didn't select any version explicitly, so I imagine NPM installed the most recent version.
Starting Mermaid CLI fails even before loading any diagram. Running the CLI without arguments or with -h shows the syntax error above.
I just saw the following when I tried to reinstall Mermaid-cli:
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'puppeteer@18.2.1',
npm WARN EBADENGINE required: { node: '>=14.1.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
Could it be that Mermaid only works with NodeJS 14? Is there any documentation about that? I am using Ubuntu 22.04, the most recent LTS, and even that one sticks to NodeJS 12.
Could it be that Mermaid only works with NodeJS 14?
Unfortunately, that's the case. Mermaid relies on puppeteer
, which dropped support for Node.JS v12 a couple of versions ago (see https://github.com/puppeteer/puppeteer/releases/tag/v14.0.0)
It doesn't help that although npm
prints a warning Node.JS is out-of-date, it's very easy to ignore since there are a lot of other warnings.
I am using Ubuntu 22.04, the most recent LTS, and even that one sticks to NodeJS 12.
Node.JS v12 has been end-of-life since 2022-04-30.
If you use the built-in Ubuntu/Debian NodeJS, they're usually running very outdated versions of NodeJS, and they're only officially supported by the OS maintainers, so you're relying on them to backport bug/security fixes, which is often difficult since their versions are so out-of-date.
My recommendation is to install a supported version of Node.JS using the official instructions: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
Installing via snap is probably the easiest way to get started if you're on Ubuntu, and it should auto-update to the latest version so you don't need to worry about security issues.
Is there any documentation about that?
I'll add an badge to the the README.md in #428 that adds to the README.md
Generally in the NPM/JavaScript eco-system, that's enough for people to understand (as well as the warnings/errors when trying to install the package, but it might be worth making it more explicit in the README.md, especially since there might be quite a few people unfamiliar with JavaScript trying to install this package.
Describe the bug When trying to run Mermaid CLI, even before rendering anything, I'm getting a syntax error preventing the tool to work at all.
To Reproduce Steps to reproduce the behavior:
The Mermaid CLI is completely unusable.
Expected behavior A clear and concise description of what you expected to happen.
Mermaid CLI should display a usage screen.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context Add any other context about the problem here.