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

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

    Run the following commands, it works fine for me.

    npm install node-sass -g

    npm rebuild node-sass

    nvm use 10.16.3

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

    ng serve --poll=2000

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

    This worked for me Deleting node_modules and then restoring packages from IDE and then npm rebuild node-sass

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

    node-sass runs an install script to download the required binary. If there are no environment variables, .npmrc variables or process arguments set then the binary is determined by using the current process platform, architecture and Node ABI version. Therefore, if you run node install in one application and then try to run node-sass in an application with a different platform/architecture/ABI, the binary won't have been downloaded. The solution is to manually download the binary or to fix the binary version using an environment variable (SASS_BINARY_NAME) or a .npmrc variable (sass_binary_name)

    You can see the logic for this in the getBinaryPath function in node-sass\lib\extensions.js

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

    Try to add suffix --force

    npm rebuild node-sass --force
    
    0 讨论(0)
  • 2020-11-29 15:15

    node-sass node module uses darwin binary file which is dependent on the version of node. This issue occurs when the binary file is not downloaded or wrong binary file is downloaded.

    Reinstall node modules will download expected binary of node-sass:-

    For Mac users:

    rm -rf node_modules
    npm cache clean --force
    npm i
    npm rebuild node-sass --force
    

    For Windows users:

    rmdir node_modules
    npm cache clean --force
    npm i
    npm rebuild node-sass --force
    

    but for some users, you need to check your node version's compatibility with node-sass version. Make it compatible using below table and run above commands again to fix this issue.

    If issue is still not fixed, check node-sass supported environment's list:- https://github.com/sass/node-sass/releases/

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

    If your terminal/command prompt says:

    Node Sass could not find a binding 
    for your current environment: 
    OS X 64-bit with Node 0.10.x

    and you have tried the following commands such as:

    npm cache clean --force 
    rm -rf node modules 
    npm install 
    npm rebuild node-sass 
    npm rebuild node-sass

    & still NOTHING works..

    Just run this in the terminal manually:

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

    now run

    npm start or yarn start

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