You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Need to auto-detect Node-Webkit (npm install nodegit not working) #212
"Uncaught Error: ENOENT, no such file or directory 'node_modules/nodegit/index.js'"
nodegit is there, just index.js is not
one time i was able to get nodegit to build and it had an index.js, unable to recreate though.
and when this happened it was unable to find the 'build/Debug/nodegit' module
I've put that into the folder and get the error Uncaught Error: Cannot find module './build/Debug/nodegit
if I remove the try blocks around "rawApi = require('./build/Release/nodegit');" I get
Uncaught Error: dlopen(node_modules/nodegit/build/Release/nodegit.node, 1): no suitable image found. Did find:
node_modules/nodegit/build/Release/nodegit.node: mach-o, but wrong architecture
Hey! So we're trying to get this package loaded in a git project we're building (same setup: node-webkit) and we're basically getting the same error that @pnispel was getting. I'm about to try this above solution to see if it works for us.
Now running the same command nw-gyp command gives me:
So I'm not sure if I'm heading down the wrong path here or if I'm missing some simple since I'm relatively new to osx or what. Any ideas? @pnispel what exactly did you do to get nw-gyp to work?
You don't create any binding.gyp files, we dynamically create it. Try running:
npm run generate
This should create the file you need. I'm not sure about the --target flag. Looks very wrong, I would omit it, unless you can research more as to what that version means.
@johnhaley81 I'd check your version of node as per here. I'm using v0.10.28 without problems. Other than that I'm not sure. You could try getting an older version of node-webkit 0.8.6 or something too I suppose.
So it was definitely v0.9.2. I switched down to 0.8.6 and things are working great! But only with a nw-gyp rebuild --target=0.9.2 so that might need to be a conditional dependency.
so I have v0.9.2 working, along with 0.10.2. (In the same project as @johnhaley81 ). The issue there was something silly with how our directory structure was set up (our project was putting other versions of node webkit in incorrect dirs).
nw-gyp works perfect though per the process @pnispel specified above, so perhaps conditionally building is the way to go. I have no clue how to set any of that up (I'm new to this too), but I'd be happy to help if someone can point me in the right direction.
@tbranyen hey so @maxkorp and I are able/willing to work full time on getting this and #136 up and running if you can point us in the right direction.
We're going to be heavily using this code in a project so we can dedicate a good amount of time bring it up to have SSH and some more interfaces into libgit2.
We both have been poking around to see how you're generating the interface into libgit2 so we'll try to get caught up on that right now. Also checking out all of the open issues and PR's you've had over the last few months to see what's been happening. Any other ideas on what else we should look at?
Now that @johnhaley81 and I have half a clue how this all works, gonna try and fix this.
So nw-gyp requires a --target argument with the node webkit version. I was thinking of attempting to look at the engines in package.json, and if they specify node-webkit, trying to match by either semver globbing, and falling back to the latest stable (if it fails or they dont specify a version). Thoughts? I suppose it wouldnt work if nodegit got used in another package, which was then used in node-webkit land though. Perhaps this issue is upstream? Maybe there needs to be a way to force using nw-gyp instead of node-gyp for a system build, agnostic of what its building.
Activity
tbranyen commentedon Aug 6, 2014
Does it actually complete? That doesn't look like all of the message. Does
require("nodegit")work? That is an expected failure in some cases.Edit: Is that a black crappie?
pnispel commentedon Aug 6, 2014
Thanks for the quick reply! Yeah the pastebin is the 20 or so lines around the failure. this is the whole thing: http://pastebin.com/bTCQQQTv
npm install npm install git://github.com/tbranyen/nodegit.git
complains about not having ejs
after npm install ejs that same command works to install but then
"Uncaught Error: ENOENT, no such file or directory 'node_modules/nodegit/index.js'"
and yes! one of the bigger ones that day
edit: also caught this that same weekend
https://dl.dropboxusercontent.com/u/42766757/411818_3450532743680_698577903_o.jpg
tbranyen commentedon Aug 6, 2014
Hrm, can you try?
pnispel commentedon Aug 6, 2014
Same thing. It complains about ejs and when ejs is there "Uncaught Error: ENOENT, no such file or directory 'node_modules/nodegit/index.js'"
pnispel commentedon Aug 6, 2014
A few more things I've tried. I have a copy of index.js that looks like http://pastebin.com/0gc6ssQz
I've put that into the folder and get the error
Uncaught Error: Cannot find module './build/Debug/nodegitif I remove the try blocks around "rawApi = require('./build/Release/nodegit');" I get
pnispel commentedon Aug 7, 2014
I forgot to mention that I'm running this in node-webkit.. which ended up being important.
I fixed by installing nw-gyp and running
nw-gyp rebuild --target=0.8.6inside nodegit.johnhaley81 commentedon Aug 18, 2014
Hey! So we're trying to get this package loaded in a git project we're building (same setup: node-webkit) and we're basically getting the same error that @pnispel was getting. I'm about to try this above solution to see if it works for us.
tbranyen commentedon Aug 18, 2014
Interesting, if nw-gyp works for you, we should look into conditionally building for that target.
johnhaley81 commentedon Aug 18, 2014
So I'm a fairly recently converting from .NET dev to Mac/node/webkit style dev so it's quite possible that I'm missing something easy.
Here's what I've tried:
sudo npm install -g nw-gypand also installed all dependencies.git clonenw-gyp rebuild --target=0.8.6Which gave me:So that led me down a path of creating a binding.gyp file in nodegit/ according to what's outlined here.
So my binding.gyp file looks like this:
Now running the same command nw-gyp command gives me:
So I'm not sure if I'm heading down the wrong path here or if I'm missing some simple since I'm relatively new to osx or what. Any ideas? @pnispel what exactly did you do to get nw-gyp to work?
pnispel commentedon Aug 18, 2014
@johnhaley81 the
targetparameter ofnw-gyp rebuild --target=0.8.6is the version of node-webkit you are using. check out this for getting the versionpnispel commentedon Aug 18, 2014
@johnhaley81 just to clarify. i believe the full process i used was:
npm install git://github.com/tbranyen/nodegit.gitnpm install ejscd node_modules/nodegitnw-gyp rebuild --target=TARGETtbranyen commentedon Aug 18, 2014
You don't create any binding.gyp files, we dynamically create it. Try running:
This should create the file you need. I'm not sure about the
--targetflag. Looks very wrong, I would omit it, unless you can research more as to what that version means.tbranyen commentedon Aug 18, 2014
@pnispel ah okay thanks for clarifying the
--targetflag.johnhaley81 commentedon Aug 18, 2014
@pnispel That target thing worked great. Now here's something interesting. When I use
sudo nw-gyp rebuild --target=0.8.6it builds just fine (bash log).
It does not however work in my application. I'm getting that same error (wrong architecture) that I was getting before which is unfortunate.
Now I have the target set to what my application is using (0.9.2) and it doesn't rebuild without errors (bash log).
The exact command I'm sending in is
sudo nw-gyp rebuild --target=0.9.2Any ideas?
pnispel commentedon Aug 18, 2014
@johnhaley81 I'd check your version of node as per here. I'm using
v0.10.28without problems. Other than that I'm not sure. You could try getting an older version of node-webkit0.8.6or something too I suppose.johnhaley81 commentedon Aug 18, 2014
@pnispel I'm on
v0.10.30of node. I'm looking into switching versions of node-webkit now to see if that will fix the issue.johnhaley81 commentedon Aug 18, 2014
So it was definitely
v0.9.2. I switched down to0.8.6and things are working great! But only with anw-gyp rebuild --target=0.9.2so that might need to be a conditional dependency.Thanks @pnispel and @tbranyen for all of your help!
maxkorp commentedon Aug 19, 2014
so I have v0.9.2 working, along with 0.10.2. (In the same project as @johnhaley81 ). The issue there was something silly with how our directory structure was set up (our project was putting other versions of node webkit in incorrect dirs).
nw-gyp works perfect though per the process @pnispel specified above, so perhaps conditionally building is the way to go. I have no clue how to set any of that up (I'm new to this too), but I'd be happy to help if someone can point me in the right direction.
johnhaley81 commentedon Aug 19, 2014
@tbranyen hey so @maxkorp and I are able/willing to work full time on getting this and #136 up and running if you can point us in the right direction.
We're going to be heavily using this code in a project so we can dedicate a good amount of time bring it up to have SSH and some more interfaces into libgit2.
We both have been poking around to see how you're generating the interface into libgit2 so we'll try to get caught up on that right now. Also checking out all of the open issues and PR's you've had over the last few months to see what's been happening. Any other ideas on what else we should look at?
[-]npm install nodegit not working[/-][+]Need to auto-detect Node-Webkit (npm install nodegit not working)[/+]maxkorp commentedon Oct 24, 2014
Now that @johnhaley81 and I have half a clue how this all works, gonna try and fix this.
So nw-gyp requires a
--targetargument with the node webkit version. I was thinking of attempting to look at the engines in package.json, and if they specify node-webkit, trying to match by either semver globbing, and falling back to the latest stable (if it fails or they dont specify a version). Thoughts? I suppose it wouldnt work if nodegit got used in another package, which was then used in node-webkit land though. Perhaps this issue is upstream? Maybe there needs to be a way to force using nw-gyp instead of node-gyp for a system build, agnostic of what its building.johnhaley81 commentedon Nov 26, 2014
Relevant stackover question: http://stackoverflow.com/questions/27154941/detecting-node-webkit-during-npm-install
maxkorp commentedon Dec 1, 2014
This should finally be fixed with the pull request referenced above.