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

前端 未结 30 2405
说谎
说谎 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 14:50

    I had the same problem with Node v7.4.0 Current (Latest Features).

    Did some reading here and downgraded Node to v6.9.4 LTS and after running npm rebuild node-sass it downloaded the binary and everything started working.

    Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-48_binding.node
    Download complete .] - :
    Binary saved to D:\xxx\xxx-xxx\node_modules\node-sass\vendor\win32-x64-48\binding.node
    Caching binary to C:\Users\user\AppData\Roaming\npm-cache\node-sass\3.13.1\win32-x64-48_binding.node`

    0 讨论(0)
  • 2020-11-29 14:52

    For my particular case none of the above answers worked. So what it worked:

    rm -rf node_modules 
    rm -rf /tmp/* 
    rm -rf /root/.npm/node-sass 
    npm uninstall --save node-sass 
    npm cache clean --force 
    

    npm cache verify to check that nothing is left in the cache

    npm install
    

    Altough I haven't tried to reproduce the sequence it was a combination of the above that worked. In addition you may also try:

    npm install --save node-sass or npm install node-sass -g

    npm rebuild node-sass
    npm install bindings
    
    0 讨论(0)
  • 2020-11-29 14:53

    Just execute: → npm rebuild node-sass --force



    If the above for some reason didn't work out for you, try this:
    1. Delete node-sass folder under node_modules
    2. npm install

    In my case it also couldn't find Python.

    Following procedure solved the issue (Windows):

    npm rebuild node-sass --force
    -- cannot find python.exe, if you have Python installed, add it to your path:
    set PYTHON=C:\Python27\Python.exe
    -- else: download python "Windows x86-64-MSI" installer from https://www.python.org/downloads/release/python-2714/
    -- install python
    -- at installation start check: add env variable to path
    -- after successfull installation:
    npm rebuild node-sass --force
    -- finished successfully
    
    0 讨论(0)
  • 2020-11-29 14:54

    I had the same problem

    There is an error in your gulpfile:
    Error: Missing binding E:\allapp\badshaindiancuisine\node_module\node-sass\vendor\win32-x64-46\binding.node
    Node Sass could not find a binding for your current environment:Windows 64-bit with Node.js 4.x

    Found bindings for the following environment:
        - OS X 64-bit with Node.js 4.x

    How to solve my problem

    By going into project folder and then execute:

    npm rebuild node-sass
    
    0 讨论(0)
  • 2020-11-29 14:54

    I had the same problem in a Windows environment, receiving the following error:

    Error: Missing binding C:\Development{ProjectName}\node_modules\node-sass\vendor\win32-ia32-47\binding.node
    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

    None of the npm commands listed in the other answers here (npm install, npm rebuild node-sass, etc.) worked.

    Instead, I had to download the missing binding and place it in the appropriate destination folder.

    The bindings can be found on git. Match the file with the folder name identified after /node_modules/node-sass/vendor/ in your error message ('darwin-x64-11' in your case, so you'd want the darwin-x64-11_binding.node file).

    Create the missing folder in your project (/node_modules/node-sass/vendor/darwin-x64-11), copy the .node file to the new directory, and rename it to binding.node.

    Node-sass release URL: https://github.com/sass/node-sass/releases

    0 讨论(0)
  • 2020-11-29 14:54

    Just run the comment thats it.

    npm rebuild node-sass

    enjoy your coding...

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