node升級后報錯Error:Node Sass does not yet support your current environment: OS X 64-bit with Unsuppor...

問題:

新項目需要將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

解決方法:

  1. 無需給node降低版本,只需升級node-sass即可
// 卸載
npm uninstall node-sass --save
// 清楚npm安裝緩存
npm cache clean -f
// 安裝node-sass
npm install --save node-sass
  1. 在install之前先執(zhí)行npm rebuild node-sass
npm rebuild node-sass
// 安裝node-sass
npm install --save node-sass
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

友情鏈接更多精彩內(nèi)容