prisma-erd-generator icon indicating copy to clipboard operation
prisma-erd-generator copied to clipboard

Command failed when i try generator

Open lokize opened this issue 1 year ago • 29 comments

Hi, i have this error when i try run npx prisma generate, I can run with the md extension but when I try to use png or svg this error occurs

image

lokize avatar Aug 17 '22 11:08 lokize

Hey @lokize this might be a duplicate issue so could you share your OS, node version, and do some validation to see if that path to mmdc engine exists?

/root/developer/Exp/Area-do-Cliente-Ceres-Sistemas/node_modules/.bin/mmdc

keonik avatar Aug 18 '22 03:08 keonik

thanks for help, yes the path exists, when i try gerenate with extension ".md" this worked

lokize avatar Aug 18 '22 11:08 lokize

That’s the confusing part. When you run with the output file as .md it skips calling that script because we’ve already translated the prisma dml to mermaid and it gets written straight to file. Any other formats get run through this script. Do another check to make sure that exists in the directory

keonik avatar Aug 18 '22 13:08 keonik

i checked again and the folder and path exists...

lokize avatar Aug 18 '22 14:08 lokize

Okay cool. Go ahead and enable debug mode and take a look at your generated mermaid file in step 3 outputted to prisma/debug/3-.... If it works in markdown it should work through the mermaid CLI so try to call the CLI manually and ensure it generates your svg/png etc. They don't really show much for debugging if it fails in the CLI. Depending on if you get through manually calling the CLI we would keep troubleshooting or open an issue with mermaid cli.

keonik avatar Aug 18 '22 15:08 keonik

Share your OS and node version as well. Most of these failures are happening for windows users

keonik avatar Aug 18 '22 15:08 keonik

i using wsl2 with CentOS9 Stream, nvm with nodejs v16.16.0

lokize avatar Aug 18 '22 17:08 lokize

Same error here, I ran the command manually and it seems to be a puppeteer issue. image

d0lb33 avatar Oct 11 '22 14:10 d0lb33

I ran: sudo apt-get install -y libgbm-dev

And now I get this error: image

Node Version: v16.17.1 PRETTY_NAME="Debian GNU/Linux 11 (bullseye)" NAME="Debian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"

d0lb33 avatar Oct 11 '22 14:10 d0lb33

So what worked for me was following the mermaid readme: image

I made this file and added it to my manual command.

d0lb33 avatar Oct 11 '22 15:10 d0lb33

I had the same problem as the author of the issue, I use Windows 11 with WSL2 (Ubuntu 22.04.1 - 5.15.68.1-microsoft-standard-WSL2) and I didn't have any special characters or spaces in the path, everything was resolved when I installed the lib " libasound2", don't ask me what this library has to do with an svg generator, but as I said, that's what solved it.

Sephyros avatar Nov 03 '22 03:11 Sephyros

I've tried everything above and what worked for me was: sudo apt-get install libxkbcommon-x11-0

I'm using Win10 WSL2 Ubuntu22.02 Node v18.12.0

pmdpaula avatar Nov 04 '22 19:11 pmdpaula

i've tried your solution @pmdpaula and @Sephyros but both didn't worked for me, i'm still having the same issue. there's another thing that i can try to do to solve this? i'm using windows 11 with WSL Ubuntu v22.04.1, nvm with node v18.12.0

image

meli-tortelli avatar Nov 05 '22 05:11 meli-tortelli

i solved already. i guess it was a duplicate module issue with the prisma generator-helper. i just had to remove the module, run yarn install and then ran again npx prisma generate.

so if anyone is having this same issue maybe try to do the same.

image

meli-tortelli avatar Nov 05 '22 06:11 meli-tortelli

i solved already. i guess it was a duplicate module issue with the prisma generator-helper. i just had to remove the module, run yarn install and then ran again npx prisma generate.

so if anyone is having this same issue maybe try to do the same.

image

It didn't work for me. I've tried it before.

pmdpaula avatar Nov 05 '22 10:11 pmdpaula