問題:
新項目需要將node版本從v8.x版本升級至v12.18.3
老項目運行時,報錯如下:
Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (64)
For more information on which environments are supported please see:

image.png
解決方法:
- 無需給node降低版本,只需升級node-sass即可
// 卸載
npm uninstall node-sass --save
// 清楚npm安裝緩存
npm cache clean -f
// 安裝node-sass
npm install --save node-sass
- 在install之前先執(zhí)行
npm rebuild node-sass
npm rebuild node-sass
// 安裝node-sass
npm install --save node-sass