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

> echarts@6.1.0 ships CommonJS and ESM builds. Dual package — require() works on every Node.js version we test; import works too.

Apache ECharts is a powerful, interactive charting and data visualization library for browser

Latest version 6.1.0, published May 19, 2026.

echarts publishes both a CommonJS entry and a native ESM entry (ESM added in 5.5.0). require("echarts") should work on every Node.js version the package supports; the runtime probe has not run for this version. import "echarts" works alongside it.

## What to do

1. Nothing to change. require("echarts") should work on every Node.js version the package supports; the runtime probe has not run for this version. import * as echarts from "echarts" works alongside it; use named imports for what the ESM entry exports.
2. TypeScript: types are bundled; install nothing extra.

## Facts

- Latest: 6.1.0 (May 19, 2026)
- Module format: Dual (CommonJS + ESM)
- Last CommonJS version: 6.1.0
- Native ESM since: 5.5.0
- TypeScript types: bundled
- Node engines: not declared
- Weekly downloads: 4.6M
- License: Apache-2.0

## Runtime test results for echarts@6.1.0

Runtime probe pending for this version (install failed: PROBE_TIMEOUT). The facts above come from package.json.

## How to import echarts

ES modules:

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

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

CommonJS:

```js
const echarts = require("echarts");
```

## Module format by version

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

| Versions | Format | First published |
|---|---|---|
| 5.5.0 – 6.1.0 | Dual (CommonJS + ESM) | Feb 18, 2024 |
| 3.2.1 – 5.4.3 | CommonJS | Jul 4, 2016 |

## Frequently asked

**Is echarts ESM-only?**

echarts@6.1.0 ships CommonJS and ESM builds. echarts publishes both a CommonJS entry and a native ESM entry (ESM added in 5.5.0). require("echarts") should work on every Node.js version the package supports; the runtime probe has not run for this version. import "echarts" works alongside it.

**Can I require echarts?**

Yes. echarts ships a CommonJS entry alongside the native ESM entry. require("echarts") should work on every Node.js version the package supports; the runtime probe has not run for this version.

**Does echarts ship TypeScript types?**

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

## Links

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