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/releasesCommon 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
- Uninstall node-sass and install sass.
- Most loaders (sass-loader, vite) auto-detect sass - no further config needed.
- Commit the updated lockfile.
Terminal
npm uninstall node-sass
npm install -D sassPin the implementation if a loader guesses wrong
- 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
Sass "Cannot find module 'sass'" - Fix in CIFix "Error: Cannot find module 'sass'" in CI - the sass package is a missing devDependency, or the runner ins…
Sass "legacy JS API" Deprecation - Fix in CIFix the Sass legacy JS API deprecation warning in CI - render()/renderSync() are deprecated; move to compile(…
sharp Install Failed (Image Processing) - Fix in CIFix a failing sharp install in CI - a missing prebuilt binary for the runner platform, or a blocked download,…