An exception in converting markdown files to PDF using atom under Ubuntu

Time:2021-10-14

Today, an exception occurred when converting markdown to PDF using atom’s mark themeable PDF plug-in: assertionerror: HTML PDF: failed to load phantom JS module. You have to set the path to the phantom JS binary using ‘options. Phantom path’

An exception in converting markdown files to PDF using atom under Ubuntu

Paste the abnormal information into Baidu to search. After looking for more than an hour, I only found the solution under windows. The solution under Linux is not no, but it is either wrong or incomplete. Then I found it on stackoverflow, and I didn’t find the relevant information. I had to climb over the wall. Finally, I found a solution from GitHub with Google, which is aimed at Linux system.

  1. Uninstall the markdown themeable PDF plug-in in atom and close atom.

  2. Terminal input sudo apt get install nodejs

  3. Terminal input sudo apt get install NPM

  4. Input sudo NPM install – G HTML PDF at the terminal (this statement will ensure that phantom JS is installed correctly)

  5. Open atom and reinstall the markdown themeable PDF plug-in

Finally, use the shortcut key Ctrl + Shift + e to perform the conversion. The successful effect is shown in the figure below

An exception in converting markdown files to PDF using atom under Ubuntu

GitHub’s solution:https://github.com/cakebake/m…