Skip to content

Instantly share code, notes, and snippets.

@ll931217
Last active March 7, 2019 07:26
Show Gist options
  • Save ll931217/2eb3bc7cdc28ab0208493db141e200a5 to your computer and use it in GitHub Desktop.
Save ll931217/2eb3bc7cdc28ab0208493db141e200a5 to your computer and use it in GitHub Desktop.
Steps to make node-sass work in electron

We actually could rebuild node-sass against Electron version. I'm successfully rebuild with following steps :

  • Follow these steps https://github.com/sass/node-sass#rebuilding-binaries until npm install don't need to run last step (node scripts/build -f)
  • In node-sass directory run following : HOME=~/.electron-gyp ./node_modules/node-gyp/bin/node-gyp.js rebuild --target=1.3.4 --arch=x64 --dist-url=https://atom.io/download/atom-shell --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library= -- Note that I'm using Electron version 1.3.4, you can change with your Electron version.
  • The output will be inside build/Release/binding.node Then you can copy that file into your node_modules/node-sass/vendor/darwin-x64-49 folder. -- Note that I'm using darwin-x-64-49, you should match this with your environment. Mine is : OSX 64bit with Electron v1.3.4 (this version using API 49, more info )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment