kimmobrunfeldt / git-hours

Estimate time spent on a git repository
MIT License
774 stars 59 forks source link

Segmentation fault and/or wrong NODE_MODULE_VERSION on Windows #35

Closed huksley closed 3 years ago

huksley commented 6 years ago

Hello!

Running on Window 8.1 + npm 6.3.0 + node 8.9.4 and getting these errors.

Installed lasted version using npm install -g git-hours nodegit

+ git-hours@1.3.0
+ nodegit@0.22.2

C:\aaa\Devel>git hours
C:\Users\aaa\AppData\Roaming\npm\node_modules\git-hours\node_modules\nodegit\dist\nodegit.js:15
    throw ex;
    ^

Error: The module '\\?\C:\Users\aaa\AppData\Roaming\npm\node_modules\git-hours\node_modules\nodegit\build\Release\nodegit.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 47. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (module.js:672:18)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\aaa\AppData\Roaming\npm\node_modules\git-hours\node_modules\nodegit\dist\nodegit.js:11:12)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\aaa\AppData\Roaming\npm\node_modules\git-hours\src\index.js:4:11)
    at Module._compile (module.js:643:30)

C:\usr>git hours
C:\Users\aaa\AppData\Roaming\npm\git-hours: line 14: 11076 Segmentation fault      node "$basedir/node_modules/git-hours/src/index.js" "$@"
kimmobrunfeldt commented 3 years ago

After new release 1.5.0, npx git-hours works again! Tested with node 14, macOS. The node version is probably quite specific.