FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Need to auto-detect Node-Webkit (npm install nodegit not working) · Issue #212 · nodegit/nodegit · GitHub

Repository navigation

Need to auto-detect Node-Webkit (npm install nodegit not working) #212

Description

OSX 10.9.4

npm install nodegit
http://pastebin.com/gkcHvsa2

using the building from source instructions

"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

Activity

  1. tbranyen commented on Aug 6, 2014

    Member

    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?

  2. pnispel commented on Aug 6, 2014

    Author

    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

  3. tbranyen commented on Aug 6, 2014

    Member

    Hrm, can you try?

    npm install git://github.com/nodegit/nodegit.git
  4. pnispel commented on Aug 6, 2014

    Author

    Same thing. It complains about ejs and when ejs is there "Uncaught Error: ENOENT, no such file or directory 'node_modules/nodegit/index.js'"

  5. pnispel commented on Aug 6, 2014

    Author

    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/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 
    
  6. pnispel commented on Aug 7, 2014

    Author

    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.6 inside nodegit.

  7. johnhaley81 commented on Aug 18, 2014

    Collaborator

    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.

  8. tbranyen commented on Aug 18, 2014

    Member

    Interesting, if nw-gyp works for you, we should look into conditionally building for that target.

  9. johnhaley81 commented on Aug 18, 2014

    Collaborator

    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:

    • Installed nw-gyp by doing sudo npm install -g nw-gyp and also installed all dependencies.
    • Cloned the repo using git clone
    • Ran nw-gyp rebuild --target=0.8.6 Which 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:

    {
      "targets": [
        {
          "target_name": "nodegit",
          "sources": [ "src/wrapper.cc" ]
        }
      ]
    }
    

    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?

  10. pnispel commented on Aug 18, 2014

    Author

    @johnhaley81 the target parameter of nw-gyp rebuild --target=0.8.6 is the version of node-webkit you are using. check out this for getting the version

  11. pnispel commented on Aug 18, 2014

    Author

    @johnhaley81 just to clarify. i believe the full process i used was:

    1. npm install git://github.com/tbranyen/nodegit.git
    2. npm install ejs
    3. cd node_modules/nodegit
    4. nw-gyp rebuild --target=TARGET
  12. tbranyen commented on Aug 18, 2014

    Member

    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.

  13. tbranyen commented on Aug 18, 2014

    Member

    @pnispel ah okay thanks for clarifying the --target flag.

  14. johnhaley81 commented on Aug 18, 2014

    Collaborator

    @pnispel That target thing worked great. Now here's something interesting. When I use

    sudo nw-gyp rebuild --target=0.8.6

    it 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.2

    Any ideas?

  15. pnispel commented on Aug 18, 2014

    Author

    @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.

  16. johnhaley81 commented on Aug 18, 2014

    Collaborator

    @pnispel I'm on v0.10.30 of node. I'm looking into switching versions of node-webkit now to see if that will fix the issue.

  17. johnhaley81 commented on Aug 18, 2014

    Collaborator

    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.

    Thanks @pnispel and @tbranyen for all of your help!

  18. maxkorp commented on Aug 19, 2014

    Collaborator

    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.

  19. johnhaley81 commented on Aug 19, 2014

    Collaborator

    @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?

  20. changed the title [-]npm install nodegit not working[/-] [+]Need to auto-detect Node-Webkit (npm install nodegit not working)[/+] on Oct 24, 2014
  21. maxkorp commented on Oct 24, 2014

    Collaborator

    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.

  22. johnhaley81 commented on Nov 26, 2014

    Collaborator
  23. added this to the milestone on Nov 26, 2014
  24. maxkorp commented on Dec 1, 2014

    Collaborator

    This should finally be fixed with the pull request referenced above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL