Could not find phantoms in the specified path
I am trying to get started with the Mermaid CLI, but when I try to run it against my original file, it says it cannot find phantomjs. (I am running Win 7 64.)
C:\Users\Chris\Documents>mermaid test.mermaid
You had errors in your syntax. Use --help for further information.
Could not find phantomjs at the specified path.
However, phantomjs is in my path and I have no problem running it from the command line.
C:\Users\Chris\Documents>phantomjs
phantomjs>
I also tried to set the phantomjs path directly. It did not help.
C:\Users\Chris\Documents>mermaid -e "C:\Users\Chris\AppData\Roaming\npm" test.mermaid
You had errors in your syntax. Use --help for further information.
Could not find phantomjs at the specified path.
Curiously, if I ask for detailed feedback, he will also tell me that he needs the source file
C:\Users\Chris\Documents>mermaid -v test.mermaid
You had errors in your syntax. Use --help for further information.
You must specify at least one source file.
Could not find phantomjs at the specified path.
So, I am wondering if there is something wrong with my source. Which, I just copied from the readme. The original file looks like this:
A[Hard edge] -->|Link text| B(Round edge)
B --> C{Decision}
C -->|One| D[Result one]
C -->|Two| E[Result two]
Any thoughts would be much appreciated.
source to share
Check out this bug https://github.com/knsv/mermaid/issues/329 which is not very OS X specific.
It seems that the mermaid project has a very strange way of relying on certain versions of dependent libraries, and for this reason it is extremely difficult to succeed.
Also, don't ignore this bug https://github.com/knsv/mermaid/issues/304 - which asks to be able to use phantomjs 2.x instead of the too old version 1.9.8
source to share
I also faced the same problem, but it was resolved. You should pay attention to the command format.
Like this: mermaid -p -o / tmp -w 3600 -e / opt / node-v4.4.7-linux-x64 / bin / phantomjs test.mmd
My environment: node-v4.4.7-Linux-x64 phantomjs - 2.1.1
If there is a problem, make sure these dependencies. d3, dagre, dagre-d3, jasmine
Good luck.
source to share
I am solving this problem. I noticed that if you install phantomjs with this it npm -g install phantomjs
is actually wrong and I don't know why.
phantomjs --help
internal/child_process.js:294
var err = this._handle.spawn(options);
^
TypeError: Bad argument
at ChildProcess.spawn (internal/child_process.js:294:26)
at exports.spawn (child_process.js:386:9)
at Object.<anonymous> (/usr/local/lib/node_modules/phantomjs-prebuilt/bin/phantomjs:22:10)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:425:7)
So, I am loading from this ,
and npm remove mermaid
and npm install -g mermaid
.
finally:
mermaid
You had errors in your syntax. Use --help for further information.
You must specify at least one source file.
source to share