# Is @aws-sdk/nested-clients ESM-only? Can you require() it?

> @aws-sdk/nested-clients@3.997.44 ships CommonJS and ESM builds, reachable only through subpaths. Dual package, subpaths only — require("@aws-sdk/nested-clients/…") works, require("@aws-sdk/nested-clients") does not.

Nested clients for AWS SDK packages.

Last verified Sep 9, 2026 against @aws-sdk/nested-clients@3.997.44.

@aws-sdk/nested-clients exposes only subpaths in its exports map, for example "@aws-sdk/nested-clients/sso"; there is no root entry, so require("@aws-sdk/nested-clients") and import "@aws-sdk/nested-clients" both throw ERR_PACKAGE_PATH_NOT_EXPORTED. Each subpath ships a CommonJS and a native ESM build, so require("@aws-sdk/nested-clients/sso") and import "@aws-sdk/nested-clients/sso" both work.

## What to do

1. Load subpaths, never the bare name: const nestedClients = require("@aws-sdk/nested-clients/sso") or import from "@aws-sdk/nested-clients/sso". require("@aws-sdk/nested-clients") throws ERR_PACKAGE_PATH_NOT_EXPORTED.
2. TypeScript: types are bundled; install nothing extra.

## Facts

- Latest: 3.997.44 (Aug 21, 2026)
- Module format: Dual (CommonJS + ESM)
- Last CommonJS version: 3.997.44
- Native ESM since: 3.730.0
- TypeScript types: bundled
- Node engines: >=20.0.0
- Weekly downloads: 57.5M
- License: Apache-2.0

## Runtime test results for @aws-sdk/nested-clients@3.997.44

Installed and executed on Sep 9, 2026 with require("@aws-sdk/nested-clients") from a CommonJS file and import "@aws-sdk/nested-clients" from an ES module.

| Runtime | require("@aws-sdk/nested-clients") | import "@aws-sdk/nested-clients" |
|---|---|---|
| Node.js 18 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) |
| Node.js 20 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) |
| Node.js 22 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) |
| Node.js 24 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) |
| Node.js 26 | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) | fails (ERR_PACKAGE_PATH_NOT_EXPORTED) |
| Bun 1.4.0 | fails (Error) | fails (Error) |

## How to import @aws-sdk/nested-clients

ES modules:

```js
import * as nestedClients from "@aws-sdk/nested-clients/sso";
```

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

CommonJS:

```js
const nestedClients = require("@aws-sdk/nested-clients/sso");
```

## Module format by version

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

| Versions | Format | First published |
|---|---|---|
| 3.996.7 – 3.997.44 | Dual (CommonJS + ESM) | Mar 6, 2026 |

## Frequently asked

**Is @aws-sdk/nested-clients ESM-only?**

@aws-sdk/nested-clients@3.997.44 ships CommonJS and ESM builds, reachable only through subpaths. @aws-sdk/nested-clients exposes only subpaths in its exports map, for example "@aws-sdk/nested-clients/sso"; there is no root entry, so require("@aws-sdk/nested-clients") and import "@aws-sdk/nested-clients" both throw ERR_PACKAGE_PATH_NOT_EXPORTED. Each subpath ships a CommonJS and a native ESM build, so require("@aws-sdk/nested-clients/sso") and import "@aws-sdk/nested-clients/sso" both work.

**Can I require @aws-sdk/nested-clients?**

Only by subpath. require("@aws-sdk/nested-clients") throws ERR_PACKAGE_PATH_NOT_EXPORTED because the exports map has no root entry; require("@aws-sdk/nested-clients/sso") works, and so does import from the same subpath.

**Does @aws-sdk/nested-clients work in Bun?**

Importing @aws-sdk/nested-clients failed in Bun 1.4.0 on Sep 9, 2026: error: Cannot find module '@aws-sdk/nested-clients' from '/Users/boat/Projects/top-seo/data/probe-work/@aws-sdk__nested-clients/imp.mjs'

**Does @aws-sdk/nested-clients ship TypeScript types?**

Yes. @aws-sdk/nested-clients bundles its own type declarations; no @types package is needed.

## Links

- [@aws-sdk/nested-clients on npm](https://www.npmjs.com/package/@aws-sdk/nested-clients)
- [Source repository](https://github.com/aws/aws-sdk-js-v3)
- [HTML version](https://canirequire.com/package/@aws-sdk/nested-clients/)
- [JSON version](https://canirequire.com/package/@aws-sdk/nested-clients.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.
