Windows环境下Ionic+Cordova构建Android项目失败问题排查
Hey there, let's break down your issue clearly:
The error Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (57) is the direct cause of your build failure.
Let's translate that tech jargon into plain terms:
Unsupported runtime (57)specifically maps to Node.js version 8.x — each Node.js release has a unique runtime identifier, and 57 is tied to Node 8.- The Node Sass version installed in your project is incompatible with Node.js 8.x: either it's a too-new version that dropped support for older Node releases like 8.x, or you've got a mismatched version that doesn't align with your current Node runtime.
Your ANDROID_HOME and JAVA_HOME configurations aren't related to this crash — this is purely a Node.js <-> Node Sass compatibility problem.
You have two reliable paths to fix this:
Option 1: Upgrade Node.js (Recommended)
Node.js 8.x has been end-of-life since 2019, so upgrading to a supported LTS (Long-Term Support) version will not only resolve this Node Sass issue but also boost your project's overall stability:
- Uninstall your current Node.js 8.x via Windows Settings > Apps.
- Download a recent LTS version (like Node 16.x or 18.x) from the official Node.js site.
- Open your project folder, delete the
node_modulesfolder andpackage-lock.jsonfile (oryarn.lockif you use Yarn). - Run
npm installto reinstall all dependencies with the new Node version. - Try running
ionic cordova build androidagain.
Option 2: Downgrade Node Sass to match Node 8.x
If you need to stick with Node 8.x for specific reasons, install a Node Sass version that supports it:
- Open your command prompt in the project directory.
- Uninstall the current Node Sass:
npm uninstall node-sass - Install a compatible version (v4.14.1 works perfectly with Node 8.x):
npm install node-sass@4.14.1 --save-dev - Once installation finishes, retry the build command.
内容的提问来源于stack exchange,提问作者Lama

