Skip to content
Latchkey

node-sass Not Supported - Migrate to dart-sass in CI

node-sass is a native LibSass binding that is end-of-life. On a CI Node version it never published a binary for, it tries to compile from source and fails - the fix is to drop it for the pure-JS sass package.

What this error means

Install or build fails with node-sass gyp errors, or a runtime message that your Node version is unsupported. Bumping Node makes it worse, not better.

node
Error: Node Sass does not yet support your current environment:
OS X 64-bit with Unsupported runtime (127)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases

Common causes

No prebuilt binary for the CI Node version

node-sass ships per-Node-version native binaries. A newer runner Node has no matching binary, so it falls back to a source build that fails.

LibSass is deprecated

LibSass (and node-sass) is no longer maintained and lacks current Sass features. dart-sass is the reference implementation.

How to fix it

Swap node-sass for sass

  1. Uninstall node-sass and install sass.
  2. Most loaders (sass-loader, vite) auto-detect sass - no further config needed.
  3. Commit the updated lockfile.
Terminal
npm uninstall node-sass
npm install -D sass

Pin the implementation if a loader guesses wrong

  1. Tell sass-loader to use the dart implementation explicitly.
webpack.config.js
// webpack.config.js (sass-loader options)
{ loader: 'sass-loader', options: { implementation: require('sass') } }

How to prevent it

  • Standardize on sass (dart-sass); never reintroduce node-sass.
  • Pin the runner Node version so binary-compatibility surprises do not appear on upgrades.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →