# Is jquery ESM-only? Can you require() it?

> jquery@4.0.0 is ESM-only. ESM-only since 4.0.0 — last CommonJS version is 3.7.1.

JavaScript library for DOM operations

Last verified Sep 9, 2026 against jquery@4.0.0.

jquery dropped its CommonJS build in 4.0.0 (January 2026). The last version with a plain require()-able CommonJS entry is 3.7.1, published Aug 28, 2023.

require("jquery") failed in our probe on Node.js 20+ as well; see the runtime table for the error before relying on it. On Node.js 18, which has no require(esm), require("jquery") fails with ERR_REQUIRE_ESM.

## What to do

1. require("jquery") failed in our probe on Node.js 20+ as well; see the runtime table for the error before relying on it.
2. From a CommonJS file, use a dynamic import inside an async function: const jquery = await import("jquery"). That works on every Node.js version the package supports.
3. If you need a synchronous require() or run Node.js 18: npm install jquery@3.7.1, the last CommonJS release (published Aug 28, 2023).
4. TypeScript: npm install -D @types/jquery

## Facts

- Latest: 4.0.0 (Jan 18, 2026)
- Module format: ESM-only
- Last CommonJS version: 3.7.1
- ESM-only since: 4.0.0 (Jan 18, 2026)
- TypeScript types: @types/jquery
- Node engines: not declared
- Weekly downloads: 11.8M
- License: MIT

## Runtime test results for jquery@4.0.0

Installed and executed on Sep 9, 2026 with require("jquery") from a CommonJS file and import "jquery" from an ES module.

| Runtime | require("jquery") | import "jquery" |
|---|---|---|
| Node.js 18 | fails (Error) | fails (Error) |
| Node.js 20 | fails (Error) | fails (Error) |
| Node.js 22 | fails (Error) | fails (Error) |
| Node.js 24 | fails (Error) | fails (Error) |
| Node.js 26 | fails (Error) | fails (Error) |
| Bun 1.4.0 | fails (Error) | fails (Error) |

## How to import jquery

ES modules:

```js
import * as jquery from "jquery";
```

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

CommonJS:

```js
// require("jquery") failed in our probe on Node.js 20.19+, 22.12+ and newer as well (jQuery requires a window with a document); see the runtime table.

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

// Or pin the last CommonJS release:
// npm install jquery@3.7.1
```

## Module format by version

Derived from the type, main and exports fields of every stable release on npm (46 versions; the newest 46 shown).

| Versions | Format | First published |
|---|---|---|
| 4.0.0 | ESM-only | Jan 18, 2026 |
| 1.5.1 – 3.7.1 | CommonJS | Mar 19, 2011 |

## Frequently asked

**Is jquery ESM-only?**

jquery@4.0.0 is ESM-only. jquery dropped its CommonJS build in 4.0.0 (January 2026). The last version with a plain require()-able CommonJS entry is 3.7.1, published Aug 28, 2023.

**Which version of jquery still supports CommonJS / require()?**

3.7.1 is the last version of jquery with a CommonJS build. Install it with "npm install jquery@3.7.1". Every version from 4.0.0 on is ESM-only.

**How do I use jquery from a CommonJS file?**

From a CommonJS file, use a dynamic import inside an async function: const jquery = await import("jquery"). That works on every Node.js version the package supports. require("jquery") failed in our probe on Node.js 20+ as well; see the runtime table for the error before relying on it. Alternatively pin jquery@3.7.1.

**Does jquery work in Bun?**

Importing jquery failed in Bun 1.4.0 on Sep 9, 2026: error: jQuery requires a window with a document

**Does jquery ship TypeScript types?**

Not bundled. Install the community types with "npm install -D @types/jquery".

## Links

- [jquery on npm](https://www.npmjs.com/package/jquery)
- [Source repository](https://github.com/jquery/jquery)
- [HTML version](https://canirequire.com/package/jquery/)
- [JSON version](https://canirequire.com/package/jquery.json)

---

For scripts and AI agents: any package is at https://canirequire.com/package/<name>/index.md (Markdown) or https://canirequire.com/package/<name>.json (JSON); the site index is https://canirequire.com/llms.txt. Fetch the URL directly; no search needed.
