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

> node-sass@9.0.0 is a CommonJS package. CommonJS — require() works on every Node.js version we test.

Wrapper around libsass

Latest version 9.0.0, published May 20, 2023.

node-sass ships CommonJS only. require("node-sass") should work on every Node.js version the package supports (>=16); the runtime probe has not run for this version. import "node-sass" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

**Deprecated:** Node Sass is no longer supported. Please use `sass` or `sass-embedded` instead.

## What to do

1. require("node-sass") should work on every Node.js version the package supports (>=16); the runtime probe has not run for this version.
2. From ES modules use the default import: import nodeSass from "node-sass"; then destructure. Named imports only work when Node.js can statically detect the exports.
3. TypeScript: npm install -D @types/node-sass
4. This package is deprecated: Node Sass is no longer supported. Please use `sass` or `sass-embedded` instead.

## Facts

- Latest: 9.0.0 (May 20, 2023)
- Module format: CommonJS
- Last CommonJS version: 9.0.0
- TypeScript types: @types/node-sass
- Node engines: >=16
- Weekly downloads: 888K
- License: MIT

## Runtime test results for node-sass@9.0.0

Runtime probe pending for this version (install failed: error: postinstall script from "node-sass" exited with 1). The facts above come from package.json.

## How to import node-sass

ES modules:

```js
import nodeSass from "node-sass";
```

CommonJS:

```js
const nodeSass = require("node-sass");
```

## Module format by version

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

| Versions | Format | First published |
|---|---|---|
| 3.5.3 – 9.0.0 | CommonJS | Apr 21, 2016 |

## Frequently asked

**Is node-sass ESM-only?**

node-sass@9.0.0 is a CommonJS package. node-sass ships CommonJS only. require("node-sass") should work on every Node.js version the package supports (>=16); the runtime probe has not run for this version. import "node-sass" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

**Can I import node-sass with ES module syntax?**

Yes. import nodeSass from "node-sass" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.

**Does node-sass ship TypeScript types?**

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

## Links

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