kimmobrunfeldt / git-hours

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

git-hours doesn't install with node 12 #43

Closed nicolas-van closed 5 years ago

nicolas-van commented 5 years ago

I'm using and Ubuntu 18.04 with node 12.6.0.

When I type npm install -g git-hours (using a working nvm configuration) I get this:

 nico@nico-Inspiron-7590  ~/code/git-hours   master  npm install -g git-hours
/home/nico/.nvm/versions/node/v12.6.0/bin/git-hours -> /home/nico/.nvm/versions/node/v12.6.0/lib/node_modules/git-hours/src/index.js

> nodegit@0.13.2 install /home/nico/.nvm/versions/node/v12.6.0/lib/node_modules/git-hours/node_modules/nodegit
> node lifecycleScripts/install

/home/nico/.nvm/versions/node/v12.6.0/lib/node_modules/git-hours/node_modules/promisify-node/utils/args.js:9
  var args = func.toString().match(/function\s.*?\(([^)]*)\)/)[1];
                                                              ^

TypeError: Cannot read property '1' of null
    at module.exports (/home/nico/.nvm/versions/node/v12.6.0/lib/node_modules/git-hours/node_modules/promisify-node/utils/args.js:9:63)
    at /home/nico/.nvm/versions/node/v12.6.0/lib/node_modules/git-hours/node_modules/promisify-node/index.js:79:29
    at Array.filter (<anonymous>)
    at processExports (/home/nico/.nvm/versions/node/v12.6.0/lib/node_modules/git-hours/node_modules/promisify-node/index.js:60:6)
    at module.exports (/home/nico/.nvm/versions/node/v12.6.0/lib/node_modules/git-hours/node_modules/promisify-node/index.js:112:10)
    at Object.<anonymous> (/home/nico/.nvm/versions/node/v12.6.0/lib/node_modules/git-hours/node_modules/nodegit/generate/scripts/generateNativeCode.js:3:13)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nodegit@0.13.2 install: `node lifecycleScripts/install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the nodegit@0.13.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/nico/.npm/_logs/2019-09-05T11_28_16_147Z-debug.log
nicolas-van commented 5 years ago

I suspect this is just a problem with nodegit 's version which is just a bit old. I'll try to make a pull request to correct this.

Mebus commented 5 years ago

Same problem here. Can somebody please merge this?

Mebus

mathieujobin commented 3 years ago

still having this issue, can't we not install this globally without a package.json ?