在指定的路径上找不到phantomjs

在指定的路径上找不到phantomjs,phantomjs,mermaid,Phantomjs,Mermaid,我正试图开始使用Mermaid CLI,但当我试图对源文件运行它时,它说它找不到phantomjs。(我正在运行Win 7 64。) 然而,phantomjs在我的路径中,我在命令提示符下运行它没有问题 C:\Users\Chris\Documents>phantomjs phantomjs> 我还尝试直接将phantomjs路径放入。这没用 C:\Users\Chris\Documents>mermaid -e "C:\Users\Chris\AppData\Roaming

我正试图开始使用Mermaid CLI,但当我试图对源文件运行它时,它说它找不到phantomjs。(我正在运行Win 7 64。)

然而,phantomjs在我的路径中,我在命令提示符下运行它没有问题

C:\Users\Chris\Documents>phantomjs
phantomjs>
我还尝试直接将phantomjs路径放入。这没用

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.
奇怪的是,如果我要求详细的反馈,它也会告诉我它需要一个源文件

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.
所以,我想知道我的消息来源是否有问题。这是我从自述中抄来的。源文件如下所示:

A[Hard edge] -->|Link text| B(Round edge)
B --> C{Decision}
C -->|One| D[Result one]
C -->|Two| E[Result two]
如果您有任何想法,我们将不胜感激。

请检查这个并非真正针对OSX的错误

mermaid项目似乎有一些非常奇怪的方式依赖于依赖库上的特定版本,因此很难成功运行它


另外,不要忽略这个bug——它要求能够使用phantomjs 2.x而不是太旧的1.9.8版。我也遇到了同样的问题,但已经解决了。 您需要注意命令格式

像这样: 美人鱼-p-o/tmp-w 3600-e/opt/node-v4.4.7-linux-x64/bin/phantomjs test.mmd

我的环境: node-v4.4.7-linux-x64 幻影JS-2.1.1

如果有问题,请确保这些依赖项。 d3,达格雷,达格雷-d3,茉莉花

祝你好运,我解决了这个问题。 我注意到,如果您通过这个
npm-g install phantomjs
安装phantomjs,实际上它是错误的,我不知道为什么

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)
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)
mermaid

You had errors in your syntax. Use --help for further information.
You must specify at least one source file.