joaompneves / tsviz

Typescript UML Visualizer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: spawn /usr/local/bin/dot ENOENT

m-abs opened this issue · comments

I'm using nvm to manage my node installation.

tsviz fails on my setup, because it tries to run /usr/local/bin/dot which doesn't exist on my system.

I installed graphviz, but since it's a system package it still doesn't exist on that path.

Did you manage to solve your problem?

Sorry for the late response.

I haven't used tsviz since I reported this issue. But I've just tried it again and it's still an issue.

My system doesn't have the executable at /usr/local/bin/dot, the correct path is /usr/bin/dot, since it's installed via the system's package manager (Fedora 24).

I think it's in the file bin/uml-builder.js it goes wrong. It checks for win32 and in the else statement it sets setGraphVizPath("/usr/local/bin").

The path might work on *BSD, since they tend to place their packages in /usr/local.

This bug also exists on Ubuntu, for the same reason. tsviz should not assume dot is installed in /usr/local/bin. Ideally, it would be able to use it wherever it is on the PATH, or at least allow an environment variable to be set to tell it where it is.

I worked around it by commenting out g.setGraphVizPath("/usr/local/bin"); in bin/uml-builder.js (line 28).

commented

@chrislong Thanks for the workaround! It saved my day using tsviz on Ubuntu 16.04.

commented

@chrislong If anyone wonders, uml-builer.js is in /usr/local/lib/node_modules/tsviz/bin/uml-builder.js on Ubuntu

We should execute dot in the path instead of at a specific location.