Skip to content

Problems with native modules #39

@timbod7

Description

@timbod7

My workflow for an electron app is

# Install all dependencies, including native modules npm install # Ensure native modules are built to match electron ./node_modules/.bin/electron-rebuild # Test the app ./node_modules/.bin/electron . # package the app ./node_modules/.bin/electron-packager . \"MyApp\" --out=dist/osx --platform=darwin --arch=x64 --version=0.33.6 --icon=assets/osx/myicon.icn # build a distribution ./node_modules/.bin/electron-builder \"dist/osx/MyApp-darwin-x64/MyApp.app\" --platform=osx --out=\"dist/osx\" --config=packager.json" 

The last step is failing with the following error:

- Starting build for ´osx´ - Writing temporary ´appdmg.json´ Wrote temporary ´appdmg.json´ Kicking off ´appdmg´ module.js:355 Module._extensions[extension](this, filename); ^ Error: Module version mismatch. Expected 14, got 46. at Error (native) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (module.js:384:17) at Object.<anonymous> (/Users/xxx/projects/myapp/myapp/electron/node_modules/electron-builder/node_modules/appdmg/node_modules/ds-store/node_modules/macos-alias/lib/create.js:7:13) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) 

I believe this is happening because the electron-builder script is running using a node implementation incompatible with electron (which is why the electron-rebuild script is necessary):

$ npm --version 2.5.1 $ node --version v0.12.0 $ ./node_modules/.bin/electron --version v0.33.6 

Is this a bug? What is the recommended way to build build distributions with native modules?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions