Skip to content
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

Installing for Electron #662

Closed
dnbkr opened this issue Aug 6, 2015 · 14 comments
Closed

Installing for Electron #662

dnbkr opened this issue Aug 6, 2015 · 14 comments

Comments

@dnbkr
Copy link

dnbkr commented Aug 6, 2015

Hi,

I'm trying to install nodegit for electron. My package.json has the following:

"engines": {
    "electron": "0.30.2",
    "atom-shell": "0.30.2"
  }

and i've tried running

npm install nodegit

and

apm install nodegit

but both complain about "Module version mismatch" sometimes it's Expected 44, got 14, and sometimes it's Expected 44, got 43

I've also tried cloning the repo and following the manual build instructions, but alas - no joy.

Any ideas?

@tbranyen
Copy link
Member

tbranyen commented Aug 6, 2015

Have you looked through our backlog of issues on this subject?

https://github.com/nodegit/nodegit/search?q=electron&type=Issues&utf8=%E2%9C%93

@dnbkr
Copy link
Author

dnbkr commented Aug 6, 2015

Yep, I tried the variations suggested by others (using both 'electron' and 'atom-shell' as engines) and tried the suggestions made by the electron team for using node modules and each time there were no compilation errors; just the console error on require.

I was wondering if perhaps it's an issue with the latest electron version? At lot of the other tickets reference older versions of electron

@johnhaley81
Copy link
Collaborator

I know that @maxkorp is trying to simplify the install process on https://github.com/nodegit/nodegit/tree/simplify-build and is also working on getting a published binary for electron.

We might have to wait for mapbox/node-pre-gyp#112 to land first but @maxkorp would know more.

@ssreekanth
Copy link

I updated dependencies in my package.json today, but now, I'm also getting the same issue.

My package.json has -

"engines": {
    "atom-shell": "0.30.2",
    "electron": "0.30.2"
  },
"dependencies": {
    "nodegit": "^0.4.1"
    "electron-prebuilt": "0.30.2",
  }

Looks like nodegit is not getting recompiled. It's fetching the prebuilt nodegit.

@erikmellum
Copy link

I am also running into the same problem when working on Electron on Mac OS X.

My problem: Error: Module did not self-register.

I built the nodegit myself by cloning and running npm install. That worked properly.
My package.json:

{
  "name": "foundation-apps-template",
  "version": "1.1.0",
  "main": "app/index.js",
  "scripts": {
    "install": "./node_modules/.bin/electron-rebuild"
  },
  "engines": {
    "atom-shell": "0.29.2",
    "electron": "0.29.2"
  },
  "dependencies": {
    "archiver": "^0.14.4",
    "bower": "^1.4.1",
    "check-dependencies": "^0.9.4",
    "electron-cookies": "^1.1.0",
    "fastclick": "^1.0.6",
    "front-router": "^1.0.0",
    "npm": "^2.13.2",
    "ps-node": "0.0.4",
    "rimraf": "^2.2.8",
    "sudo-prompt": "^1.1.2"
  },
  "devDependencies": {
    "chokidar": "^1.0.3",
    "electron-prebuilt": "^0.26.0",
    "electron-rebuild": "^0.2.5",
    "gulp": "^3.8.10",
    "gulp-autoprefixer": "^1.0.1",
    "gulp-concat": "^2.4.2",
    "gulp-if": "^1.2.5",
    "gulp-livereload": "^3.8.0",
    "gulp-load-plugins": "^0.8.0",
    "gulp-ng-annotate": "^1.1.0",
    "gulp-ng-html2js": "^0.2.0",
    "gulp-ruby-sass": "^0.7.1",
    "gulp-run": "^1.6.8",
    "gulp-sass": "^1.3.3",
    "gulp-uglify": "^1.0.2",
    "gulp-util": "^3.0.6",
    "run-sequence": "^1.0.2",
    "yargs": "^3.6.0"
  },
  "private": true
}

@ssreekanth
Copy link

I don't see this issue anymore with electron 0.30.4

@erikmellum
Copy link

I upgraded to 0.30.4 and still can't get it working. I tried in both the renderer, and the main process.

@maxkorp
Copy link
Collaborator

maxkorp commented Aug 17, 2015

It actually seems largely based on the version of node you're using initially to do the install before rebuilding against electrons headers. If you use node11/node12/iojs/apm for install, it should work, but with node10 it seems to break.

@johnhaley81
Copy link
Collaborator

Oh! I've had issues with installing with node 10 as well. I was able to do it after I bumped to node v0.10.40.

@maxkorp
Copy link
Collaborator

maxkorp commented Aug 17, 2015

Really? That's unusual, that means it's not what I thought it was causing that issue >.<

@erikmellum
Copy link

I also tried node v10 and v12.7 and didn't have success in either case. I tried moving nodegit to both main and renderer processes with no luck.

@maxkorp
Copy link
Collaborator

maxkorp commented Aug 17, 2015

Hrmmm, could have sworn that the node10 version of http_parser was the issue.

@simonhochrein
Copy link

I also had this problem and fixed it with HOME=~/.electron-gyp node-gyp rebuild --target=0.30.2 --arch=x64 --dist-url=https://atom.io/download/atom-shell. It will recompile nodegit for electron.
(it might take a few minutes though)

@maxkorp
Copy link
Collaborator

maxkorp commented Aug 18, 2016

Closing out all of these old electron-how-to issues.

@maxkorp maxkorp closed this as completed Aug 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants