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

> three@0.186.0 is ESM-only. ESM-only since 0.186.0 — last CommonJS version is 0.185.1.

JavaScript 3D library

Last verified Sep 9, 2026 against three@0.186.0.

three dropped its CommonJS build in 0.186.0 (September 2026). The last version with a plain require()-able CommonJS entry is 0.185.1, published Jul 1, 2026.

On Node.js 20.19+, 22.12+ and newer, require("three") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 20, 22, 24 and 26. On Node.js 18, which has no require(esm), require("three") fails with ERR_REQUIRE_ESM.

## What to do

1. On Node.js 20.19+, 22.12+ and newer, require("three") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 20, 22, 24 and 26.
2. From a CommonJS file, use a dynamic import inside an async function: const three = await import("three"). That works on every Node.js version the package supports.
3. If you need a synchronous require() or run Node.js 18: npm install three@0.185.1, the last CommonJS release (published Jul 1, 2026).
4. TypeScript: npm install -D @types/three

## Facts

- Latest: 0.186.0 (Sep 8, 2026)
- Module format: ESM-only
- Last CommonJS version: 0.185.1
- ESM-only since: 0.186.0 (Sep 8, 2026)
- TypeScript types: @types/three
- Node engines: not declared
- Weekly downloads: 14.0M
- License: MIT

## Runtime test results for three@0.186.0

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

| Runtime | require("three") | import "three" |
|---|---|---|
| Node.js 18 | fails (ERR_REQUIRE_ESM) | works |
| Node.js 20 | works | works |
| Node.js 22 | works | works |
| Node.js 24 | works | works |
| Node.js 26 | works | works |
| Bun 1.4.0 | works | works |

## How to import three

ES modules:

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

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

CommonJS:

```js
// Node.js 20.19+, 22.12+ and newer (verified):
const three = require("three");

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

// Or pin the last CommonJS release:
// npm install three@0.185.1
```

## Module format by version

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

| Versions | Format | First published |
|---|---|---|
| 0.186.0 | ESM-only | Sep 8, 2026 |
| 0.144.0 – 0.185.1 | Dual (CommonJS + ESM) | Aug 31, 2022 |

## Frequently asked

**Is three ESM-only?**

three@0.186.0 is ESM-only. three dropped its CommonJS build in 0.186.0 (September 2026). The last version with a plain require()-able CommonJS entry is 0.185.1, published Jul 1, 2026.

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

0.185.1 is the last version of three with a CommonJS build. Install it with "npm install three@0.185.1". Every version from 0.186.0 on is ESM-only.

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

From a CommonJS file, use a dynamic import inside an async function: const three = await import("three"). That works on every Node.js version the package supports. On Node.js 20.19+, 22.12+ and newer, require("three") works with the latest version: Node.js loads synchronous ES modules through require(). Verified on Node.js 20, 22, 24 and 26. Alternatively pin three@0.185.1.

**Does three work in Bun?**

Yes. import "three" loaded successfully in Bun 1.4.0 on Sep 9, 2026.

**Does three ship TypeScript types?**

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

## Links

- [three on npm](https://www.npmjs.com/package/three)
- [Source repository](https://github.com/mrdoob/three.js)
- [HTML version](https://canirequire.com/package/three/)
- [JSON version](https://canirequire.com/package/three.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.
