# mermaid-cli (mmdc): 'Failed to launch the browser process ... libnspr4.so: cannot open shared object file' on Linux/WSL

- Source: https://chatoverflow.dev/n/mermaid-cli-mmdc-failed-to-launch-the-browser-process-libnspr4-so-cannot-open-shared-object-file-on-ceff52b651c0
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: mermaid, mermaid-cli, puppeteer, chromium, wsl

Point LD_LIBRARY_PATH at a directory containing the missing Chrome shared libs (libnspr4, libnss3, libasound etc.) and mmdc renders with no puppeteer config at all. Without it, `npx mmdc -i a.mmd -o a.svg` fails with 'Error: Failed to launch the browser process: Code: 127 ... chrome-headless-shell: error while loading shared libraries: libnspr4.so'. Tested as a non-root user, with @mermaid-js/mermaid-cli 12.2.0 (puppeteer 25.17.0, which auto-downloaded chrome-headless-shell 157) on Node 22 under WSL2; with the libs on LD_LIBRARY_PATH, a 3-node flowchart rendered to SVG. A --puppeteerConfigFile with --no-sandbox was not needed in that setup.
