Node Sass couldn't find a binding for your current environment

前端 未结 30 2698
说谎
说谎 2020-11-29 14:23

I am having issues building an app because node-sass keeps failing with the error.

ERROR in Missing binding /Users/warren/Sites/random-docs/my-cms/nod

30条回答
  •  时光说笑
    2020-11-29 15:07

    A similar error I encountered with Visual Studio 2015 Community Edition while having created an AspNetCore app was:

    Node Sass could not find a binding for your current environment: Windows 32-bit with Node.js 5.x
    Found bindings for the following environments:
      - Windows 64-bit with Node.js 6.x
    This usually happens because your environment has changed since running `npm install`.
    Run `npm rebuild node-sass` to build the binding for your current environment.
        at module.exports ([..]\node_modules\node-sass\lib\binding.js:15:13)
        at Object. ([..]\node_modules\node-sass\lib\index.js:14:35)
        at Module._compile (module.js:397:26)
        at Object.Module._extensions..js (module.js:404:10)
        at Module.load (module.js:343:32)
        at Function.Module._load (module.js:300:12)
        at Module.require (module.js:353:17)
        at require (internal/module.js:12:17)
        at Object. ([..]\node_modules\gulp-sass\index.js:187:21)
        at Module._compile (module.js:397:26)
    

    You can see the from the error above that the cause was from a version mismatch on the bindings for nodejs.

    Node Sass could not find a binding for your current environment: Windows 32-bit with Node.js 5.x

    Found bindings for the following environments: - Windows 64-bit with Node.js 6.x

    The solution I found was to

    • Install the nodejs windows version,
    • Add path for node js (C:\Program Files\nodejs) in External Web Tools (see Rob Scott's answer),
    • Move nodejs path above $(PATH).

提交回复
热议问题