Alright, here’s what I’ve got. It’s not the best way to do it, but I was able to get past the DLL error without a problem.
I installed Node v5.1.1 using
nvm and reinstalled
electron-rebuild globally. I don’t actually know if you need to do this, but I wanted to be running on the same version of Node as Electron.
I followed the instructions listed here, including running the build script just to make sure I didn’t have any issues doing that. It’s worth noting that you cannot just run
npm install node-sass and have it work; you have to follow those instructions.
scripts/build.js, I added the following arguments to the
path.join() on line 133:
'--target=0.36.10', '--arch=x64', '--dist-url=https://atom.io/download/atom-shell'
so the line now reads:
var args = [require.resolve(path.join('node-gyp', 'bin', 'node-gyp.js')), 'rebuild', '--verbose', '--target=0.36.10', '--arch=x64', '--dist-url=https://atom.io/download/atom-shell'].concat(
node scripts/build -f from the node-sass directory, I copied the resulting
binding.node file from
vendor/win32-x64-47 to the
node-sass directory in my project’s
node_modules, replacing the previous build.
Once I did that, I was able to run Electron without any DLL issues. I’m dealing with other unrelated bugs right now that are crashing my Electron app, so I haven’t tested to see whether it works or not yet, but so far it’s something.
Right now, you’d probably have to create a build for each platform you’re planning on deploying to, or include the modified
node-sass source and a compiler that
node-gyp can work with.
EDIT: It might not be fully working as expected. My project (so far) uses the Harp web server, which has
node-sass as a dependency. When running Electron with Foundation 6 for Sites, I get a Sass compiler error saying
media query expression must begin with ')', but if I go to the frontend directory and run
harp server from the CLI it works without a problem.
I’m going to experiment some more to figure out what’s going on and to see if I can fix it.
electron-rebuild seems to be broken on my end for whatever reason…