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

前端 未结 30 2408
说谎
说谎 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:03

    Worked for me:

    Just delete the node-sass folder and run npm install.

    0 讨论(0)
  • 2020-11-29 15:05

    The post dependencies for node-sass is not getting installed without the package.json inside node-sass

    Running it manually solved for me

    node node_modules/node-sass/scripts/install.js 
    

    credit: link

    0 讨论(0)
  • 2020-11-29 15:05

    None of the install/rebuild solutions resolved the issue for me (using gulp).

    Here is how I resolved it:

    1) Download the missing binding file from the repository.

    2) Rename the file binding.node.

    3) Create node_modules/node-sass/vendor/darwin-x64-11 (path from error message) directory if it doesn't exist.

    4) Add the binding file to node_modules/node-sass/vendor/darwin-x64-11

    0 讨论(0)
  • 2020-11-29 15:06

    npm rebuild node-sass --force

    Or, if you are using node-sass within a container:

    docker exec <container-id> npm rebuild node-sass --force

    This error occurs when node-sass does not have the correct binding for the current operating system.

    If you use Docker, this error usually happens when you add node_modules directly to the container filesystem in your Dockerfile (or mount them using a Docker volume).

    The container architecture is probably different than your current operating system. For example, I installed node-sass on macOS but my container runs Ubuntu.

    If you force node-sass to rebuild from within the container, node-sass will download the correct bindings for the container operating system.

    See my repro case to learn more.

    0 讨论(0)
  • 2020-11-29 15:06

    in some cases you need to uninstall and install node-sass library. Try:

    npm uninstall --save node-sass
    

    and

    npm install --save node-sass
    

    look at this its work for me, Stack link here

    0 讨论(0)
  • 2020-11-29 15:06

    For Visual Studio 2015/2017, Right Click on your package.json and Click on Restore Packages.

    This will make sure that the npm from the Visual Studio Tools External Tools is run and the binding will be rebuild based on that.

    0 讨论(0)
提交回复
热议问题