bakunin95 / wavi

Web Application Viewer - generate class diagram for web application
Other
145 stars 23 forks source link

Error: spawn fdp ENOENT #14

Open williamgranli opened 8 years ago

williamgranli commented 8 years ago

I'm running the following command, on Ubuntu:

sudo nodejs /usr/bin/wavi --svg node_application/ /home/dev/Desktop/result.svg

It crashes with the below error while generating the graph (seems like it's towards the end of the graph generation):

generating graph (could take several minutes)...
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn fdp ENOENT
    at exports._errnoException (util.js:1007:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
    at onErrorNT (internal/child_process.js:348:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Before this I tried running it with just wavi --svg dir1 file.svg but I got the same error.

Any idea what causes this?

bakunin95 commented 8 years ago

Does node_application exist in usr/bin/wavi ? if not you need to adjust your paths according to /usr/bin/wavi

williamgranli commented 8 years ago

@bakunin95 usr/bin/wavi is not a directory, it's the executable file for wavi. I'm not sure if I'm understanding the arguments which should be passed or if I'm passing the right ones. This is my understanding, please correct me if I'm wrong:

sudo nodejs /usr/bin/wavi [1] --svg node_application/ [2] /home/dev/Desktop/result.svg [3]

[1] should point to the location where my wavi executable is [2] should point to the folder I want to analyze [3] should point to the location to where I want my diagram to be generated

bakunin95 commented 8 years ago

yes, thats the way to do it and all the folder would be relative from where you call the function. in windows the command wavi would be global and you could call it from anywhere, i havent tested if the global function work in linux.

williamgranli commented 8 years ago

@bakunin95 OK, do you have any idea why it crashes then? I'm getting the error which I specified in the first post, and all my paths are relatative.

By the way, the wavi command is global in linux as well. Running below command produces the same result as when specifying the location of the wavi executable: sudo wavi --svg node_application/ /home/dev/Desktop/result.svg

bakunin95 commented 8 years ago

i would just try something simple first: sudo wavi --svg node_application result.svg

if the error is instant then it must be a path problem.

williamgranli commented 8 years ago

Just tried that (and have done so before), and it did not work. Same error towards the end which seems to be when the graph has been generated. (I.e. the error is not instant which suggests there is no path problem).

bakunin95 commented 8 years ago

I just tested the code and I think I understand the error now, it means that it does not recognize the command "fdp". try running "fdp" in your terminal to see if it exist, if it does not exist it means that you need to download Graphviz and add your graphviz/bin folder to your path environment variable.

the "fdp" command takes the graph info as a text and generate an svg with it.

williamgranli commented 8 years ago

That the problem, however, a new one occurred. See below.

80% JavaScripts files analyzed...
87% JavaScripts files analyzed...
finished js analysis...
finished misc analysis...
generating graph (could take several minutes)...
Error (main.js): Warning: Overlap value "prism" unsupported - ignored
failed at node 2605[0]
fdp: maze.c:313: chkSgraph: Assertion `np->cells[0]' failed.

Let me know if this is unrelated this issue and if you want me to create a new one.

verbraucher commented 7 years ago

I have the same issue as a windows-user. Graphivz is installed and the PATH-variable is setted.

What can I do?

C:\software\eqm\eqm\src\main\resources\public>wavi --svg assets\js uml.svg
finished HTML analysis...
(...)
finished js analysis...
finished misc analysis...
generating graph (could take several minutes)...
###########################################################################
Error: Require Graphviz 2.38 or later
Graphviz is not installed, too old or the os environment path is not set proprel
y
Graphviz download:  http://www.graphviz.org/Download.php
Add Graphviz bin folder to environment variable path (ex.: 'C:Program Files (x86
)Graphviz2.3in')
###########################################################################
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn fdp ENOENT
    at exports._errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
bakunin95 commented 7 years ago

i just updated wavi, you can try with this command after updating wavi:

wavi assets\js uml.svg

bakunin95 commented 7 years ago

The problem is it cannot find fdp wich is part of graphviz and the new version of wavi use an integrated javascript compiled version of graphviz so you dont need anymore the graphviz library installed on your computer.