Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
Azure App Service

How to Fix Puppeteer on Azure Web Apps

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If Puppeteer reports libnspr4.so: cannot open shared object file on Azure App Service for Linux, Chromium is missing a native operating-system library. In the Linux Code hosting model, a Microsoft Q&A moderator says those system packages cannot be installed or modified; use a custom Linux container when your browser needs dependencies you must control. This distinction is key: npm can install Puppeteer, but it cannot supply the host libraries Chromium needs.

First identify which Azure hosting mode you use

Azure App Service for Linux can run an application using a managed Code runtime or a custom container image. The fix for a missing Chromium shared library depends on which one is running your app.

Hosting mode Who controls operating-system packages? What it means for Puppeteer
App Service Linux Code The platform supplies the managed runtime. Microsoft Q&A moderator Praneeth Maddali stated in an answer dated February 19, 2026 that OS-level packages cannot be installed or modified in this mode. Installing Puppeteer with npm does not add missing Linux libraries. If Chromium needs libraries unavailable in the managed runtime, move the workload to a container-based host.
App Service Web App for Containers You provide and maintain the application’s container image. Install dependencies in the image and configure Puppeteer, Chromium, security and process handling for that image.
Azure Container Apps You deploy a container image for your workload. Build an image with the browser and its required operating-system dependencies, then validate it in the chosen hosting configuration.

The Code-runtime limitation above is attributed to the Microsoft Q&A moderator’s answer to this specific error, not to a universal statement about every Azure configuration. The response recommends container-based hosting when an application needs custom system libraries or native dependencies. See the Azure custom-container configuration guide for App Service setup details.

Read the launch error before changing code

The reported failure included process exit code 127 and this message: /tmp/chromium: error while loading shared libraries: libnspr4.so: cannot open shared object file. That indicates the dynamic loader cannot find a library required by the browser executable. The Microsoft Q&A moderator identifies missing Chromium host dependencies, including libnspr4 and libnss3, as the problem class.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A successful npm install only confirms that Node packages were installed. Chromium also depends on native Linux shared libraries, which are not installed by adding a JavaScript package. Collect the full launch error and the actual browser executable path before choosing a fix; a different error may need a different remedy.

Diagnose missing libraries on the actual browser binary

  1. Record the complete error. Include the executable path Puppeteer attempted to launch, the loader message and the process exit code if present.
  2. Run the check in the same Linux image that runs the app. Use ldd on the browser executable itself, not on a different local installation. Puppeteer’s troubleshooting guidance gives this check: ldd /path/to/chrome | grep not.
  3. Interpret the results. Any line marked “not found” identifies an unresolved shared library. Match the library to a package for your image’s Linux distribution and install the required package in that image.
  4. Retest after rebuilding. Verify the dependency check against the browser binary that the deployed application actually launches.

Use Puppeteer’s current troubleshooting guidance as the reference for its common Linux dependencies. Its Debian/Ubuntu list includes libnspr4, libnss3, GTK and font libraries, X11 libraries and others. Package names and requirements can vary with the Linux distribution and browser version, so do not assume that a list for one image is correct for another.

Fix the hosting environment

If the app uses Linux Code hosting

Do not try to solve a missing host library by adding it to package.json, an npm postinstall script or the app startup command. Those mechanisms install or run application code; they do not give the app ownership of the managed runtime’s operating-system packages. For the limitation specific to this failure, the Microsoft Q&A moderator’s recommendation is to use container-based hosting.

Choose App Service Web App for Containers or Azure Container Apps according to your deployment needs, then build and deploy a custom Linux image containing the browser dependencies. The Q&A response identifies both as container-based options; it does not establish a price, performance or plan-level winner between them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If the app already uses a custom container

  1. Start from a Linux distribution and base image you intend to maintain.
  2. Install the operating-system packages required by the selected Puppeteer and browser combination.
  3. Build and test the image, checking the actual browser with ldd so unresolved libraries are found before deployment.
  4. Deploy the image using the host’s custom-container configuration and inspect application and container logs if startup or browser launch still fails.

Puppeteer’s Docker guide describes an image that bundles Chrome for Testing and its dependencies. It is a starting point, not a guarantee that the example works unchanged with every Azure host, Linux image or plan. The guide says its sandbox-mode image requires the SYS_ADMIN capability and recommends an init process, such as --init or a suitable entrypoint, to manage child processes. Confirm how those requirements apply to the selected Azure container host before adopting an image or configuration.

Keep Chromium sandboxing and process cleanup in scope

Missing shared libraries and browser sandbox failures are different issues. Do not treat --no-sandbox as a routine fix for launch problems: Puppeteer strongly discourages disabling Chrome’s sandbox. Configure a suitable sandbox and validate the container’s user and capabilities for the chosen host. If you follow an image example, check its assumptions rather than copying flags without understanding their effect.

Also account for Chromium’s child processes. Puppeteer’s Docker guidance recommends process-init management, which helps reap processes spawned by the browser. Whether to use --init or a suitable entrypoint depends on how the container is launched and what the Azure host supports.

Check Node.js and App Service setup separately

Correct browser libraries do not fix an application that fails to build, bind its port or start. Azure’s Node.js App Service guidance covers runtime selection, deployment build automation, startup configuration, logs and production-mode checks. Verify these independently:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Use a Node.js runtime supported by the App Service configuration you deploy.
  • Ensure deployment build automation installs the production dependencies needed by the app, including Puppeteer where applicable.
  • Set the intended startup command and confirm it launches the right application entry point.
  • Have the web app listen on the port provided through process.env.PORT.
  • Review app and container logs to distinguish Node startup errors from Chromium loader errors.

These are application deployment requirements; they do not add native Chromium libraries to a managed Code runtime.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make browser versions and image changes reproducible

Chromium’s required libraries depend on the browser build and Linux distribution. In a container, keep the base image, Puppeteer package and browser version aligned, and validate them together when updating any of the three. Pinning versions makes a deployment easier to reproduce; it also means you must update them deliberately to pick up compatibility and security changes. Re-run the unresolved-library check after image changes rather than assuming a previous result still applies.

Azure plan prices, regional availability, quotas and comparative performance are not established by the cited guidance here. Choose a host based on whether it supports the dependency control and runtime configuration your workload needs, then confirm current Azure details for your own deployment.

Troubleshooting common failures

Symptom Likely cause Next step
libnspr4.so or another .so file is “not found” A required native library is absent from the runtime environment. Check the actual executable with ldd. On Linux Code hosting, use a container if the dependency cannot be supplied in the managed runtime; in a container, install the distribution-appropriate package and rebuild.
npm install succeeds but Puppeteer cannot launch JavaScript dependencies are present, but one or more operating-system libraries may not be. Read the full loader error and inspect the browser binary with ldd.
Browser starts locally but not in the deployed container The deployed image may differ in distribution, packages, browser binary or version. Run the dependency check and version checks inside the deployed image; rebuild with dependencies for that image.
Chromium launch fails after dependency checks pass The remaining issue may concern sandbox setup, container capabilities, user configuration or writable paths. Check the browser’s full error and validate its sandbox and runtime requirements against the container host. Avoid defaulting to --no-sandbox.
App Service reports an application startup or availability problem The Node process may not be starting correctly or listening on the expected port. Check deployment and startup logs, the configured startup command and binding to process.env.PORT.
Browser child processes accumulate or are not reaped The container may lack process-init handling. Review Puppeteer’s Docker guidance and configure a supported init process or entrypoint for the way the container is run.

Or skip the browser setup

If your goal is to capture a website rather than operate Chromium yourself, ScreenshotNeo provides a screenshot API and MCP server. A single GET request returns a PNG, JPEG or WebP screenshot, or a PDF. Its API accepts the same parameter names used by other screenshot APIs, which can make switching easier. See the ScreenshotNeo API documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For example, using cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo accepts cookie or consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info and capture_pdf to AI agents and MCP clients such as Claude and Cursor. The Free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots. Every feature is on every plan. Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month without a card.

Sources

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.