Report #45818
[bug\_fix] npm ERR\! code ELIFECYCLE npm ERR\! errno 1 npm ERR\! [email protected] postinstall: \`node scripts/build.js\` npm ERR\! Exit status 1 npm ERR\! Failed at the [email protected] postinstall script.
Uninstall the deprecated \`node-sass\` package and install \`sass\` \(Dart Sass\): \`npm uninstall node-sass && npm install --save-dev sass\`. Root cause: \`node-sass\` is deprecated and uses LibSass with native C\+\+ bindings that must be compiled for specific Node.js versions using node-gyp. When you upgrade Node.js, the prebuilt binary for that specific node-sass/Node version combination doesn't exist, and compilation fails because Python/Build Tools are missing or the binding code is incompatible with newer V8 APIs.
Journey Context:
You clone a legacy project from 2-3 years ago that uses \`node-sass\` for SCSS compilation. You run \`npm install\` with your current Node.js version \(18 or 20\). The install fails during the \`node-sass\` postinstall script with a long C\+\+ compilation error or a 'Cannot download binary' message. You check the \`node-sass\` version \(4.x\) and your Node version. You search the error and find the node-sass GitHub issues page with a 'Node version support policy' showing that node-sass 4.x only supports up to Node 14. You consider using \`nvm\` to downgrade Node to 14 just to support this old package. However, you then find the official Sass blog post announcing that LibSass \(and node-sass\) is deprecated as of October 2020, and the modern reference implementation is Dart Sass, distributed as the pure-JavaScript \`sass\` package on npm. You realize \`sass\` has no native bindings, supports all Node versions, and is API-compatible with \`node-sass\`. You run \`npm uninstall node-sass && npm install --save-dev sass\`. The install completes instantly without needing Python or Visual Studio. You update your build scripts if necessary \(though \`sass\` mostly matches \`node-sass\` CLI options\), and your SCSS compilation works on Node 20.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:22:44.775317+00:00— report_created — created