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

Unable to use in electron projects #1383

Closed
atrauzzi opened this issue Oct 6, 2017 · 5 comments
Closed

Unable to use in electron projects #1383

atrauzzi opened this issue Oct 6, 2017 · 5 comments

Comments

@atrauzzi
Copy link

atrauzzi commented Oct 6, 2017

I have an electron project which I am building using webpack. I have configured the node-loader plugin so that any requests for .node files are handled correctly. I also am using electron-rebuild to ensure the native module is built against the version of nodejs being used in my electron project.

Unfortunately, it still seems to error out with the following:

 ERROR in ./node_modules/nodegit/dist/nodegit.js
 Module not found: Error: Can't resolve '../build/Debug/nodegit.node' in 'C:\Users\atrauzzi\Development\atrauzzi\gerty\node_modules\nodegit\dist'
  @ ./node_modules/nodegit/dist/nodegit.js 18:11-49
  @ ./src/Layer/Domain/Thunktor/Git/CloneGitRepository.ts
  @ ./src/Layer/Gerty/Component/Repository/AddGitHubRepository.tsx
  @ ./src/Layer/Gerty/Component/Repository/AddRepository.tsx
  @ ./src/Layer/Gerty/Component/Workspace.tsx
  @ ./src/Layer/Gerty/Component/App.tsx
  @ ./src/Layer/Gerty/GertyServiceProvider.ts
  @ ./src/Bundle/GertyElectron.ts

The most suspicious thing here is the Debug as when I check the path it's trying to load, all I get is this:

image

It's a somewhat educated guess, but the fact that I'm only getting Release seems suspicious. I'm just not sure of how to make nodegit request Release instead of Debug or alternatively how to make the build produce a Debug version.

It might be that the instructions to get going with electron and/or webpack need to be updated, but I'm hoping you guys can offer some help in the meantime.

😄

@atrauzzi
Copy link
Author

atrauzzi commented Oct 7, 2017

Have posed a general question to Stack Overflow, although I'd love any assistance from maintainers in getting this boulder moved!

@newblord
Copy link

newblord commented Oct 16, 2017

check out my boilerplate project i created. It uses Electron, Webpack, React and NodeGit.

https://github.com/newblord/electron-react-webpack-nodegit-boilerplate

dont use nodeloader. Instead use webpack externals, assuming your using webpack.

@cjhoward92
Copy link
Collaborator

Follow this article. All you will need is for your --target param to match that of the electron version you wish to compile to.

@MMcKester
Copy link

MMcKester commented Jul 18, 2020

Hi @cjhoward92

Follow this article. All you will need is for your --target param to match that of the electron version you wish to compile to.

Hi, can you ellaborate that? I use Electron and try to use nodegit. I installed nodegit through npm i. Thank you!

@LiminalSpaces
Copy link

@atrauzzi
By chance, did you ever manage to get nodegit importing properly via webpack with electron?

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

5 participants