9
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Markdown PDFで Error: Failed to launch the browser process! が発生した際の解消方法

Posted at

概要

  • Windowsの環境では問題ないのにWSL2環境でのみVSCode拡張機能Markdown PDFがエラーになる現象が発生したのでそれの解決方法の備忘録

内容

Error: Failed to launch the browser process!
/root/.vscode-server/extensions/yzane.markdown-pdf-1.4.4/node_modules/puppeteer-core/.local-chromium/linux-722234/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md

解決方法

WSL内にブラウザをインストールして拡張機能にPathを設定すればいい

sudo apt-get install -y chromium-browser
chromium-browser --version
which chromium-browser
  • which chromium-browserで出力されたPathをmarkdown-pdfのPathとして保存する
"markdown-pdf.executablePath": "/usr/bin/chromium-browser"
  • 今回はWSL環境の問題なのでリモート[WSL: Ubuntu]を選択して設定した

設定箇所

  • その他、Markdownで日本語を使う場合、日本語フォントが入っていないとPDF化した際に文字化けになるのでWSLに日本語フォントをインストールする
sudo apt-get install -y fonts-ipafont

参考資料

9
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?