[原創]異常報錯 npm rebuild node-sass` to build the binding for your current node version

遇到一個node版本過低導致的問題,項目是個老項目,本地一直跑不起來,後來才發現是本地node版本過高導致,編譯過程中有下面的異常報錯。
解決方法:只需要把node切換成項目匹配的版本即可。
推薦:node管理工具nvm

Module build failed: Error: The `libsass` binding was not found in F:\work\cunqi                                                                                            ngfms\fas\fas-frontend\node_modules\node-sass\vendor\win32-x64-64\binding.node
This usually happens because your node version has changed.
Run `npm rebuild node-sass` to build the binding for your current node version.
    at Object.sass.getBinaryPath (F:\work\cunqingfms\fas\fas-frontend\node_modul                                                                                            es\node-sass\lib\extensions.js:158:11)
    at Object.<anonymous> (F:\work\cunqingfms\fas\fas-frontend\node_modules\node                                                                                            -sass\lib\index.js:16:36)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (F:\work\cunqingfms\fas\fas-frontend\node_modules\sass                                                                                            -loader\index.js:4:12)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章