# 2021-01-09 #「Mermaid」- Running as root without --no-sandbox is not supported

問題描述

當運行 mmdc 命令時,產生以下錯誤:node

# mmdc -i demo.mmd -o demo.png
/usr/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer/lib/cjs/pup
peteer/node/BrowserRunner.js:193
            reject(new Error([
                   ^

Error: Failed to launch the browser process!
[1223/191612.455014:FATAL:zygote_host_impl_linux.cc(117)] No usable sandbox! Upd
ate your kernel or see https://chromium.googlesource.com/chromium/src/+/master/d
ocs/linux/suid_sandbox_development.md for more information on developing with th
e SUID sandbox. If you want to live dangerously and need an immediate workaround
, you can try using --no-sandbox.
#0 0x56445399fb39 base::debug::CollectStackTrace()
#1 0x5644539124c3 base::debug::StackTrace::StackTrace()
#2 0x564453922c80 logging::LogMessage::~LogMessage()

問題緣由

由於沒有什麼研究,因此緣由咱們也並不清楚(這各問題但是常常出現的)。linux

解決方法

第一步、建立 puppeteer-config.json 文件:json

{
  "args": ["--no-sandbox"]
}

第二步、使用該配置文件運行:ide

mmdc -p puppeteer-config.json ...

參考文獻

WikiNotes/Running as root without --no-sandbox is not supported
mermaid-cli/linux-sandbox-issue.md at master · mermaid-js/mermaid-cli
Solve 「The SUID sandbox helper binary was found, but is not configured correctly.」 (3 solutions!) | by Authmane Terki | Mediumui

相關文章
相關標籤/搜索