Registry / devops / lightningcss-darwin-arm64

lightningcss-darwin-arm64

JSON →
library1.32.0jsnpmunverified

LightningCSS (version 1.32.0) is a high-performance CSS parser, transformer, and minifier primarily written in Rust. This `lightningcss-darwin-arm64` package specifically provides the native bindings compiled for macOS on Apple Silicon (ARM64) architectures. While users typically interact with the main `lightningcss` package, this package is automatically installed as a platform-specific dependency to provide the underlying Rust-powered functionalities. It is known for its exceptional speed, making it a robust alternative to JavaScript-based CSS processors, and is a core component of the Parcel bundler. The project maintains an active development cycle, evidenced by frequent updates (e.g., v1.32.0, v1.31.0) introducing support for the latest CSS specifications like container queries, `@property` at-rule enhancements, view transitions, and continuous performance optimizations and bug fixes. Its differentiators include Rust-native performance, comprehensive and up-to-date CSS spec support, and advanced features like CSS Modules hashing and browser compatibility targeting.

npm install lightningcss-darwin-arm64
INSTALL
IMPORT
SIG · LIGHTNINGCSS-DARWI
L
lightningcss-darwin-arm64
devopsjavascriptv1.32.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

transform
import { transform } from 'lightningcss';
const { transform } = require('lightningcss');
The `lightningcss` package automatically loads the correct platform-specific native binding (like `lightningcss-darwin-arm64`). Always import from 'lightningcss', not the specific binding. ESM is the recommended import style.
bundle
import { bundle } from 'lightningcss';
const { bundle } = require('lightningcss');
Used for bundling multiple CSS files, resolving `@import` rules, and handling CSS Modules.
CSSOptions
import type { CSSOptions } from 'lightningcss';
Type import for configuration options when using TypeScript.

Demonstrates how to use `lightningcss` to transform and minify CSS, including features like nesting and browser targeting. This code processes an input string, minifies it, generates a sourcemap, and saves the output to a file.

import { transform } from 'lightningcss'; import fs from 'node:fs/promises'; async function processCss() { const inputCss = ` :root { --primary-color: #3498db; } .container { display: flex; background-color: var(--primary-color); padding: 20px; border-radius: 8px; @media (min-width: 768px) { padding: 40px; } } .button { color: white; background: var(--primary-color); &:hover { background: darken(var(--primary-color), 10%); } } `; try { const { code, map } = transform({ filename: 'input.css', code: Buffer.from(inputCss), minify: true, sourceMap: true, targets: { chrome: 100 }, drafts: { nesting: true, customMedia: true } }); console.log('Minified CSS:\n', code.toString()); // console.log('Source Map:\n', map?.toString()); await fs.writeFile('output.min.css', code); console.log('Output written to output.min.css'); } catch (error) { console.error('Error processing CSS:', error); } } processCss();
Debug
Known issues
breakingIn v1.30.0, relative color parsing was updated to the latest CSS specification. This change affects calculations involving percentages in relative colors, which now often require numbers instead. Code utilizing older relative color calculations with percentages may need updates.
fix
Review CSS code using relative color calculations (e.g., `rgb(from red r 10% 20%)`) and update percentage values to numbers where the spec now requires it. Refer to the `lightningcss` release notes and CSS Color Module Level 5 for details.
affects: >=1.30.0
gotchaThis package (`lightningcss-darwin-arm64`) is a platform-specific native binary. It is typically installed automatically as a dependency of the main `lightningcss` package. Direct installation or importing from this specific package is generally not recommended or necessary for most users.
fix
Always install and import from the `lightningcss` package, which handles the selection and loading of the correct native binary for your environment.
affects: >=1.0.0
gotchaThe `lightningcss` package, and by extension its native bindings, requires Node.js version 12.0.0 or higher. Running with older Node.js versions will lead to errors.
fix
Ensure your Node.js environment is version 12.0.0 or newer. Upgrade Node.js using `nvm` or your preferred method.
affects: <12.0.0 (Node.js)
Errors
Common errors & fixes
Error: NAPI_VERSION_MISMATCH
The installed native module (lightningcss-darwin-arm64) was compiled for a different Node-API version than the currently running Node.js runtime.
fix
Upgrade or downgrade your Node.js version to match the expected version for the installed `lightningcss` package, or try reinstalling `lightningcss` after updating Node.js to ensure native bindings are rebuilt for the current environment. A `rm -rf node_modules && npm install` (or `yarn install`) often resolves this.
Error: Cannot find module 'lightningcss-darwin-arm64'
The native binary for your operating system or architecture could not be found or loaded, often due to an incomplete installation, incorrect platform detection, or a corrupted `node_modules`.
fix
Ensure `npm install` (or `yarn install`) completed successfully. Verify that your system architecture (e.g., `arm64` vs `x64`) matches the expected binary. Try clearing your `node_modules` and `package-lock.json` (or `yarn.lock`) and reinstalling: `rm -rf node_modules package-lock.json && npm install`.
TypeError: (0 , lightningcss__WEBPACK_IMPORTED_MODULE_0__.transform) is not a function
This error typically occurs in a bundled environment (like Webpack or Rollup) or with incorrect CommonJS `require()` usage when `lightningcss` is primarily an ESM module, leading to a default import being accessed as a named import.
fix
Ensure you are using named ESM imports: `import { transform } from 'lightningcss';`. If in a CommonJS context, verify your transpiler configuration or try `const { transform } = await import('lightningcss');` for async CJS interop, or ensure your bundler is configured to correctly handle ESM exports.
Upgrade
Version history
1.32.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
lightningcss-darwin-arm64 — npm install lightningcss-darwin-arm64 · libregistry