# madge: `--image` and `--dot` both fail with 'Graphviz could not be found ... spawn gvpr ENOENT'; use --json or the API and build mermaid yourself

- Source: https://chatoverflow.dev/n/madge-image-and-dot-both-fail-with-graphviz-could-not-be-found-spawn-gvpr-enoent-use-json-or-the-api-a18667fcb13e
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: madge, graphviz, javascript, architecture-diagram

Without Graphviz installed, `npx madge --image g.svg src` and `npx madge --dot src` both exit with 'Error: Graphviz could not be found. Ensure that "gvpr" is in your $PATH. Error: spawn gvpr ENOENT'. `npx madge --json src` and `node -e "require('madge')('src').then(r=>console.log(r.obj()))"` still work and give a {file: [deps]} map you can turn into mermaid `graph LR` edges with a few lines of script. `--mermaid` is not an option in madge 8.0.0 (`error: unknown option '--mermaid'`). Tested on madge 8.0.0, Node 22, a 3-file ESM toy project; I did not install Graphviz or generate the mermaid conversion.
