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

ERROR: phantomjs binary does not exist #2

Closed
williewould opened this issue Nov 6, 2016 · 23 comments
Closed

ERROR: phantomjs binary does not exist #2

williewould opened this issue Nov 6, 2016 · 23 comments
Labels

Comments

@williewould
Copy link

Trying to generate a pdf, and keep getting this error:
ERROR: phantomjs binary does not exist: C:\Users\user_name\.vscode\extensions\yzane.markdown-pdf-0.1.4\node_modules\phantomjs-pre
I have tried running the command several times, but still keep getting this error.

I can't actually open the .pdf it generates. Please excuse me if its a trivial problem - I am new to using VSC. I also installed Auto-open Markdown packages.

Thanks in advance.

@yzane
Copy link
Owner

yzane commented Nov 13, 2016

With the Internet connected, please open the markdown file with vscode.
Then phantomjs binary will be installed.

@0tarof
Copy link

0tarof commented Nov 15, 2016

I found same issue in my environment.

I got following error:

ERROR: phantomjs binary does not exist: /Users/USERNAME/.vscode/extensions/yzane.markdown-pdf-0.1.4/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs

but phantomjs pre-built binary is installed in:

/Users/USERNAME/.vscode/extensions/yzane.markdown-pdf-0.1.4/node_modules/phantomjs-prebuilt/bin/phantomjs

Please check again.

@yzane
Copy link
Owner

yzane commented Nov 15, 2016

Thank you for your report.

The following file is not a binary file.

/Users/USERNAME/.vscode/extensions/yzane.markdown-pdf-0.1.4/node_modules/phantomjs-prebuilt/bin/phantomjs

Is there the following phantomjs binary file?

  • Windows
    • C:\Users\USERNAME\.vscode\extensions\yzane.markdown-pdf-0.1.4\node_modules\phantomjs-prebuilt\lib\phantom\bin\phantomjs.exe
  • Linux
    • ~/.vscode/extensions/yzane.markdown-pdf-0.1.4/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs

@applee
Copy link

applee commented Nov 24, 2016

If phantomjs is found in lib or on PATH, it will not be re-copied to dir ~/.vscode/extensions/yzane.markdown-pdf-0.1.4/node_modules/phantomjs-prebuilt/lib/phantom/bin. So I think you should just use ~/.vscode/extensions/yzane.markdown-pdf-0.1.4/node_modules/phantomjs-prebuilt/bin/phantomjs instead here, it will always work well.

@adison
Copy link

adison commented Dec 22, 2016

With the Internet connected, please open the markdown file with vscode.
Then phantomjs binary will be installed.

--
This solution doesn't work for me.

@amiuhle
Copy link

amiuhle commented Dec 22, 2016

Having the same problem, got it working by symlinking the phantomjs binary:

mkdir -p ~/.vscode/extensions/yzane.markdown-pdf-0.1.4/node_modules/phantomjs-prebuilt/lib/phantom/bin
ln -s ~/.vscode/extensions/yzane.markdown-pdf-0.1.4/node_modules/phantomjs-prebuilt/bin/phantomjs  ~/.vscode/extensions/yzane.markdown-pdf-0.1.4/node_modules/phantomjs-prebuilt/lib/phantom/bin/

@eminsenay
Copy link

eminsenay commented Dec 27, 2016

I also had the same problem. Downloading the latest phantomjs and pasting the exe under C:\Users\USERNAME\.vscode\extensions\yzane.markdown-pdf-0.1.4\node_modules\phantomjs-prebuilt\lib\phantom\bin\ workaround solved it.

@nuomi1
Copy link

nuomi1 commented Jan 6, 2017

For macOS 10.12 (brew was installed):

brew install phantomjs
cd ~/.vscode/extensions/yzane.markdown-pdf-0.1.4/node_modules/phantomjs-prebuilt
mkdir lib/phantom/bin
ln -s /usr/local/bin/phantomjs lib/phantom/bin/phantomjs

@yzane
Copy link
Owner

yzane commented Jan 8, 2017

Thanks for report.
@applee I will check it.

@yzane
Copy link
Owner

yzane commented Jan 9, 2017

Released 0.1.5 with this fix.
Please update!

@eminsenay
Copy link

Still getting the same error after uninstall/install:
ERROR: phantomjs binary does not exist: C:\Users[usernamehere].vscode\extensions\yzane.markdown-pdf-0.1.5\node_modules\phantomjs-prebuilt\lib\phantom\bin\phantomjs.exe

@yzane
Copy link
Owner

yzane commented Jan 11, 2017

@eminsenay Thanks for info.
Markdown-pdf will automatically download phantomjs.
In version 0.1.4, if phantomjs were found in PATH, an error occurred.
This problem was fixed in version 0.1.5.
However, it seems that an error has occurred due to other causes.

With this fix, if phantomjs is found in PATH it will be used.
Therefore, if an error occurs, please download and install phantomjs from here and set it to PATH.

@Amroll
Copy link

Amroll commented Feb 4, 2017

I got a same error after install when I used "Convert Markdown to PDF". but when I install Node.js and reload this ext. This error is fixed.
So, I think here maybe has some problem.

Another method to resolve this error(just windows):

  1. Download phantomjs from here
  2. Extract (unzip) the content and copy the bin folder to

C:\Users[usernamehere].vscode\extensions\yzane.markdown-pdf-0.1.5\node_modules\phantomjs-prebuilt\lib\phantom

  1. Restart vscode.

@deadlydog
Copy link

deadlydog commented Mar 17, 2017

Same problem for me as well

ERROR: phantomjs binary does not exist: C:\Users\USERNAME\.vscode\extensions\yzane.markdown-pdf-0.1.6\node_modules\phantomjs-prebuilt\lib\phantom\bin\phantomjs.exe

What's weird is the file does exist at that location though. After doing the steps above of manually downloading and overwriting that file, then it works as expected.

@andyrdavidson
Copy link

Same problem for me as well. @Amroll solution works for me. Like @deadlydog the file already existed at the appropriate location.

@yzane yzane added the bug label Apr 1, 2017
@yzane
Copy link
Owner

yzane commented Apr 8, 2017

Since the size limit of the extensions increased from 20 MB to 100 MB, we included phantomjs.exe for Windows in Markdown-PDF 0.1.7.
Increase Extension Size Limit

@marsdotpset
Copy link

marsdotpset commented Jun 24, 2017

I got a same error after install when I used "Convert Markdown to PDF".

Error message is
ERROR: phantomjs binary does not exist: /Users/username/.vscode/extensions/yzane.markdown-pdf-0.1.7/node_modules/phantomjs-prebuilt/lib/phantom\bin\phantomjs.exe
The last two path separator are '\', not '/'.

I can found this exe file under the right path, but the default permissions of ~/.vscode/extensions/yzane.markdown-pdf-0.1.7/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs.exe
is -rw-r--r--, maybe it should be -rwxr-xr-x?

OS: OS X EI Caption
Markdown PDF: 0.1.7

@peiyaoli
Copy link

I met the same issue as @marsdotpset ,
OS: ubuntu16.04
Markdown PDF:0.1.7

@malk271
Copy link

malk271 commented Jul 13, 2017

Same issue on MacOSX. The pre-build phantomjs.exe executable is a Windows binary. Not usable by OSX or Linux.

@malk271
Copy link

malk271 commented Jul 13, 2017

Simplest workaround for OSX users, at least, is to install Node.js (https://nodejs.org/en/), then go into the extensions directory and rebuild phantomjs:

cd $HOME/.vscode/extensions/yzane.markdown-pdf-0.1.7/node_modules/phantomjs-prebuilt
/usr/local/bin/node install.js

@Sway007
Copy link

Sway007 commented Oct 6, 2017

For Mac

brew install phantomjs

For Ubuntu

apt install phantomjs

then restart vscode, problem solved

@angelok1
Copy link

angelok1 commented Oct 25, 2017

@malk271's rebuilding phantomjs suggestion worked for me on high sierra.

@yzane
Copy link
Owner

yzane commented Apr 21, 2018

Markdown PDF ver1.0.0 replaced PDF converter with puppeteer instead of node-html-pdf.
Therefore PhantomJS is no longer used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests