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
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:
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.
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.
@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)
Activity
maxkorp commentedon Dec 16, 2014
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.
bbone87 commentedon Dec 16, 2014
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.
maxkorp commentedon Dec 16, 2014
Ah, thats a relief. Glad it's working for you. 👍
tjcarroll11 commentedon Nov 5, 2018
@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