node-sass模塊報(bào)錯安裝不上?試試這個方法,親測有效

node-sass 模塊報(bào)錯、老是安裝不上?

Syntax Error: Error: Missing binding D:\code\xxxx\node_modules\node-sass\vendor\win32-x64-83\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 14.x

Found bindings for the following environments:
  - Windows 64-bit with Unsupported runtime (93)

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
image.gif

node-sass這個模塊很坑爹,一直報(bào)錯安裝不上,試了各種辦法。

用了npm install 、cnpm install 、yarn install 都不行。

后來發(fā)現(xiàn)是node-sass模塊對node版本有兼容性,版本不適配,就容易報(bào)錯。

下圖是node-sass和 node的對應(yīng)的版本

node-sass模塊 對于node版本.png
image.gif

如果切換node版本后,仍然報(bào)錯,嘗試重新構(gòu)建下 node-sass模塊

在項(xiàng)目目錄下打開cmd:

輸入命令: npm rebuild node-sass
然后再更新一下:npm update

image.gif

或者刪除原先的node-pass,然后cnpm install node-pass 都可以

看下效果,運(yùn)行順利

image.png

<figcaption class="cke_widget_editable" contenteditable="true" data-cke-display-name="標(biāo)題" data-cke-enter-mode="2" data-cke-filter="74" data-cke-widget-editable="caption">標(biāo)題</figcaption>

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

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