canirequire

canirequire › ESM-only › puppeteer

Is puppeteer ESM-only? Can you require() it?

A high-level API to control headless Chrome over the DevTools Protocol

Latest version 25.10.0, published Sep 3, 2026. Markdown · JSON

ESM-only ESM-only since 25.0.2 — last CommonJS version is 24.43.1

puppeteer dropped its CommonJS build in 25.0.2 (May 2026). The last version with a plain require()-able CommonJS entry is 24.43.1, published May 11, 2026; it declares support for Node.js >=18.

On Node.js 22.12+ and newer (puppeteer@25.10.0 declares Node.js >=22.12.0), require() of ESM packages usually works unless the package uses top-level await. Node.js 18 has no require(esm), and puppeteer@25.10.0 declares Node.js >=22.12.0, so 18 is outside its supported range anyway.

What to do

  1. On Node.js 22.12+ and newer (puppeteer@25.10.0 declares Node.js >=22.12.0), require() of ESM packages usually works unless the package uses top-level await.
  2. From a CommonJS file, use a dynamic import inside an async function: const puppeteer = await import("puppeteer"). That works on every Node.js version the package supports (>=22.12.0).
  3. If you need a synchronous require() or run Node.js 18: npm install puppeteer@24.43.1, the last CommonJS release (published May 11, 2026); it declares Node.js >=18.
  4. TypeScript: types are bundled; install nothing extra.
Latest
25.10.0 (Sep 3, 2026)
Module format
ESM-only
Last CommonJS version
24.43.1
ESM-only since
25.0.2 (May 15, 2026)
TypeScript types
Bundled
Node engines
>=22.12.0
Weekly downloads
10.4M
License
Apache-2.0

Does puppeteer@25.10.0 actually load? Runtime test results

Runtime probe pending for this version. The values below are what package.json declares; they are refreshed once the probe runs.

Runtimerequire("puppeteer")import "puppeteer"
Node.js 18✗ expected✓ expected
Node.js 20depends✓ expected
Node.js 22depends✓ expected
Node.js 24depends✓ expected
Node.js 26depends✓ expected
Bun 1.4.0pendingpending

Install failed in our sandbox: PROBE_TIMEOUT The rows above show what package.json declares.

How to import puppeteer

ES modules (import)

import * as puppeteer from "puppeteer";

Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.

CommonJS (require)

// Node.js 22.12+ and newer (unless the package uses top-level await):
const puppeteer = require("puppeteer");

// Any Node.js version the package supports (>=22.12.0), from an async function:
async function main() {
  const puppeteer = await import("puppeteer");
}

// Or pin the last CommonJS release (declares Node.js >=18):
// npm install puppeteer@24.43.1

Module format by version

Derived from the type, main and exports fields of every stable release on npm, corrected where a runtime test of that version contradicted them (366 versions; the newest 60 shown).

VersionsFormatFirst published
25.0.2 – 25.10.0ESM-onlyMay 15, 2026
24.16.2 – 24.43.1Dual (CommonJS + ESM)Aug 14, 2025

Frequently asked

Is puppeteer ESM-only?

puppeteer@25.10.0 is ESM-only. puppeteer dropped its CommonJS build in 25.0.2 (May 2026). The last version with a plain require()-able CommonJS entry is 24.43.1, published May 11, 2026; it declares support for Node.js >=18.

Which version of puppeteer still supports CommonJS / require()?

24.43.1 is the last version of puppeteer with a CommonJS build; it declares Node.js >=18. Install it with "npm install puppeteer@24.43.1". Every version from 25.0.2 on is ESM-only.

How do I use puppeteer from a CommonJS file?

From a CommonJS file, use a dynamic import inside an async function: const puppeteer = await import("puppeteer"). That works on every Node.js version the package supports (>=22.12.0). On Node.js 22.12+ and newer (puppeteer@25.10.0 declares Node.js >=22.12.0), require() of ESM packages usually works unless the package uses top-level await. Alternatively pin puppeteer@24.43.1 (declares Node.js >=18).

Does puppeteer ship TypeScript types?

Yes. puppeteer bundles its own type declarations; no @types package is needed.

Links

Other esm-only packages

Similar popularity