https://backstage.io/docs/features/techdocs/how-to-guides#using-markdown-inline-mermaid
This mentions to add RUN yarn global add @mermaid-js/mermaid-cli. However, yarn global has been removed from yarn a while ago. What should be done instead? I realize that the better way to do all this would be to simply generate the docs in an automated workflow separately from Backstage, but that would slow adoption. I want to set up a PoC first.
#Setting up mermaid docs outdated
3 messages · Page 1 of 1 (latest)
I also tried adding it to here:
RUN yarn --cwd packages/backend add \
@backstage/plugin-catalog-backend-module-github \
@backstage/plugin-catalog-backend-module-github-org \
@mermaid-js/mermaid-cli
But when I go to the actual page with the mermaid diagram in it, I am met with the following:
Error : [Errno 2] No such file or directory: 'mmdc'
Args : ['mmdc', '-p', '/tmp/tmprgm2zxdt/puppeteer-config.json', '-o', '/tmp/tmprgm2zxdt/out.svg']
When I put this in my Dockerfile instead:
RUN npm install -g @mermaid-js/mermaid-cli,
I am met with this:
Error : Image not created
Args : ['mmdc', '-p', '/tmp/tmp_fdzluvc/puppeteer-config.json', '-o', '/tmp/tmp_fdzluvc/out.svg']
stdout : Generating single mermaid chart
stderr :
No input file specified, reading from stdin. If you want to specify an input file, please use `-i .` You can use `-i -` to read from stdin and to suppress this warning.
Error: Could not find Chrome (ver. 130.0.6723.116). This can occur if either
1. you did not perform an installation before running the script (e.g. `npx puppeteer browsers install chrome-headless-shell`) or
2. your cache path is incorrectly configured (which is: /home/node/.cache/puppeteer).
For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.
at ChromeLauncher.resolveExecutablePath (file:///usr/local/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserLauncher.js:266:27)
at ChromeLauncher.executablePath (file:///usr/local/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/node/ChromeLauncher.js:202:25)
at ChromeLauncher.computeLaunchArguments (file:///usr/local/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/node/ChromeLauncher.js:83:37)
at async ChromeLauncher.launch (file:///usr/local/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserLauncher.js:45:28)
at async run (file:///usr/local/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:498:17)
at async cli (file:///usr/local/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:203:3)