Skip to content

Require generating error #329

Closed
Closed

Description

@bbone87

I'm getting the following error when I add require('nodegit') to my project.

module.js:340
    throw err;
    ^
Error: Cannot find module '../build/Debug/nodegit'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/vagrant/node_modules/nodegit/lib/nodegit.js:12:12)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
error: Forever detected script exited with code: 8
error: Script restart attempt #1

I went ahead and add a console.log(e) on line 12 of lib/nodegit.js and got the following:

[Error: /vagrant/node_modules/nodegit/build/Release/nodegit.node: invalid ELF header]

Thoughts?

Activity

  1. maxkorp commented on Dec 16, 2014

    @maxkorp
    Collaborator

    Hrm, it seems that whatever binaries you ended up with are incorrect. How did you install the module?

    If it was via NPM, can you see if it downloads the binary, or if it's building it? Try removing nodegit from your node_modules, and reinstalling it, and log the output. It seems likely that it's not properly detecting your os/arch, and downloading when it should be building.

  2. bbone87 commented on Dec 16, 2014

    @bbone87
    Author

    Ah yes, I'm running the app on a vagrant VM but ran the install on my development machine as opposed to the VM. Was able to resolve the issue. Thanks, @maxkorp.

  3. maxkorp commented on Dec 16, 2014

    @maxkorp
    Collaborator

    Ah, thats a relief. Glad it's working for you. 👍

  4. tjcarroll11 commented on Nov 5, 2018

    @tjcarroll11

    @maxkorp I'm getting the same issue when trying to build it through docker. Using a base image of centos 7. It definitely is building the binary too. My build script has BUILD_ONLY=true npm install nodegit && npm install

     Error: /documentation-manager/node_modules/nodegit/build/Release/nodegit.node: invalid ELF header
    local_1  |     at Object.Module._extensions..node (module.js:682:18)
    local_1  |     at Module.load (module.js:566:32)
    local_1  |     at tryModuleLoad (module.js:506:12)
    local_1  |     at Function.Module._load (module.js:498:3)
    local_1  |     at Module.require (module.js:597:17)
    local_1  |     at require (internal/module.js:11:18)
    local_1  |     at Object.<anonymous> (/documentation-manager/node_modules/nodegit/dist/nodegit.js:11:12)
    local_1  |     at Module._compile (module.js:653:30)
    local_1  |     at Object.Module._extensions..js (module.js:664:10)
    local_1  |     at Module.load (module.js:566:32)
    local_1  |     at tryModuleLoad (module.js:506:12)
    local_1  |     at Function.Module._load (module.js:498:3)
    local_1  |     at Module.require (module.js:597:17)
    local_1  |     at require (internal/module.js:11:18)
    
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions