Closed KernelDeimos closed 3 years ago
I was able to fix this by moving /usr/local/lib/node_modules/nodegit/build/Release
to /usr/local/lib/node_modules/git-hours/node_modules/nodegit/Debug
after installing nodegit separately
+1
docker run --rm -v $(pwd):/code khor/git-hours
@Panthro thank you...... god i literally hate NPM so much.
Also doesn't install for me. I installed nodegit before. Not sure whether it is the same issue.
➜ ~ npm install -g nodegit
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
> nodegit@0.27.0 install /home/benoit/.nvm/versions/node/v12.10.0/lib/node_modules/nodegit
> node lifecycleScripts/preinstall && node lifecycleScripts/install
[nodegit] Running pre-install script
[nodegit] Running install script
node-pre-gyp
WARN Using request for node-pre-gyp https download
[nodegit] Success: "/home/benoit/.nvm/versions/node/v12.10.0/lib/node_modules/nodegit/build/Release/nodegit.node" is installed via remote
[nodegit] Completed installation successfully.
> nodegit@0.27.0 postinstall /home/benoit/.nvm/versions/node/v12.10.0/lib/node_modules/nodegit
> node lifecycleScripts/postinstall
+ nodegit@0.27.0
added 164 packages from 160 contributors in 13.214s
➜ ~ npm install -g git-hours
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
/home/benoit/.nvm/versions/node/v12.10.0/bin/git-hours -> /home/benoit/.nvm/versions/node/v12.10.0/lib/node_modules/git-hours/src/index.js
> nodegit@0.13.2 install /home/benoit/.nvm/versions/node/v12.10.0/lib/node_modules/git-hours/node_modules/nodegit
> node lifecycleScripts/install
/home/benoit/.nvm/versions/node/v12.10.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/benoit/.nvm/versions/node/v12.10.0/lib/node_modules/git-hours/node_modules/promisify-node/utils/args.js:9:63)
at /home/benoit/.nvm/versions/node/v12.10.0/lib/node_modules/git-hours/node_modules/promisify-node/index.js:79:29
at Array.filter (<anonymous>)
at processExports (/home/benoit/.nvm/versions/node/v12.10.0/lib/node_modules/git-hours/node_modules/promisify-node/index.js:60:6)
at module.exports (/home/benoit/.nvm/versions/node/v12.10.0/lib/node_modules/git-hours/node_modules/promisify-node/index.js:112:10)
at Object.<anonymous> (/home/benoit/.nvm/versions/node/v12.10.0/lib/node_modules/git-hours/node_modules/nodegit/generate/scripts/generateNativeCode.js:3:13)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703: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/benoit/.npm/_logs/2020-08-20T08_10_21_921Z-debug.log
➜ ~ npm -v
6.13.6
I've re-implemented the algo here: https://github.com/benckx/git-hours-estimator
docker run --rm -v $(pwd):/code khor/git-hours
How can you pass arguments to this like the example usage?
git hours --since 2015-01-31
After new release 1.5.0, npx git-hours
works again! Tested with node 14, macOS. The node version is probably quite specific.
Same error as #14 is reported when attempting to run
git-hours
.First was using node 8.10.0, but I tried switching to the latest 5 and latest 4 using nvm and I still couldn't get it working.
Addition: I also tried installing the latest version of nodegit which doesn't produce an error when I install it (
sudo npm install -g nodegit@0.20.0
) and that didn't work either