-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module mismatch following readme instructions #23
Comments
Turns out that the module mismatch problem can be fixed by installing electron-rebuild
and running it after npm install. This step's purpose is to rebuild native Node.js modules against the version of Node.js that your Electron project is using. Remember that electron comes with its own internal version of node. The rebuild step will rebuild the node module
This means we don't need to remove the ^ from package.json. Whatever version of electron is installed, the rebuild step will repair any module mismatch issues. |
@abulka, thanks for the above. Did you manage to pack the application? I manage to compile it ok, but still, have the same error when running the generated executable(MODULE_VERSION...). I tried adding the argument I run this bash script to do the whole thing at once:
|
I am also running into the error @jafermarq pointed out. Specifically, I'm getting the error |
ok @jafermarq I found the error. When you use the electron packager, change the '--electron-version' tag to the version of electron that packages are being rebuild to (1.8.4). And make sure that all of the node modules are being included by using the '--no-prune' flag. |
Following the recommended readme instructions, where
package.json
contains:results in a javascript error
because specifying
"electron": "^1.7.6"
, these days (2018) will cause npm to actually pick up electron 1.8.4 - which won't work with your custom zerorpc version.This is because the
^
symbol in package.json means the latest available 1.* version of electron is searched for and installed, see npm versioning.I finally got the example to work by removing the ^
thus causing that exact version of electron to be installed, which matches your 'prebuilt' zerorpc dependency
"zerorpc": "git+https://github.com/fyears/zerorpc-node.git"
.I believe that the readme should be updated to remove the ^ from package.json to help users avoid this problem.
The text was updated successfully, but these errors were encountered: