Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows - cli - could not find phantomjs at the specified path #236

Closed
raghur opened this issue Oct 26, 2015 · 3 comments
Closed

Windows - cli - could not find phantomjs at the specified path #236

raghur opened this issue Oct 26, 2015 · 3 comments

Comments

@raghur
Copy link
Contributor

raghur commented Oct 26, 2015

Phantomjs is on the path. Both mermaid and phantomjs are installed globally.

C:\Users\xxxxxxxxxxxxxxxxxx>phantomjs
phantomjs> ^CTerminate batch job (Y/N)?
C:\Users\raghuramanr.STC>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.

C:\Users\xxxxxxxxxxxxxxxxxx>where phantomjs
C:\Program Files\nodejs\phantomjs
C:\Program Files\nodejs\phantomjs.cmd

C:\Users\xxxxxxxxxxxxxxxxxx>phantomjs -v
1.9.8

C:\Users\xxxxxxxxxxxxxxxxxx>node -v
v4.2.1
@JasperTack
Copy link

I have encountered something similar when calling mermaid manually with nodejs. It turns out there is a bug in the cli.js file where phantomjs is being called. The error is caused by spaces in the filepath of the phantomjs executable on line 185 in cli.js:
https://github.com/knsv/mermaid/blob/master/lib/cli.js#L185

When putting the path of phantomjs between quotes like this

exec('"' + phantomPath + '" --version', function(err, stdout, stderr) {...}))

phantomjs should be found.

@knsv
Copy link
Collaborator

knsv commented Jan 19, 2016

Thanks @JasperTack. This should be an easy fix.

raghur added a commit to raghur/mermaid that referenced this issue Feb 1, 2016
Quote phantomPath so that it doesn't fail on windows when path has spaces. Fixes mermaid-js#236
@raghur
Copy link
Contributor Author

raghur commented Feb 1, 2016

@JasperTack Thanks! I just sent in a pr as I have to work with windows :(

-R

@knsv knsv closed this as completed in #286 Feb 1, 2016
mgenereu pushed a commit to mgenereu/mermaid that referenced this issue Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants