kimmobrunfeldt / git-hours

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

Proper installation instructions? #56

Closed Aditya94A closed 3 years ago

Aditya94A commented 3 years ago

Neither npm, docker or vagrant routes work as expected when following the readme.

Was anyone able to get this to work?

My two cents: This should be mentioned in the readme so more devs time is not wasted :/

DataGreed commented 3 years ago

Did not manage to install it via npm on macOS. Tried with sudo, also did not work.

Philipp122 commented 3 years ago

Did not manage to install it via npm on macOS. Tried with sudo, also did not work.

Same Problem here, was not able to install on MacOS Big Sur 11.1. NodeJS and NPM are fully up-to-date

ndastur commented 3 years ago

Can't install either. I have an error in the install script

.nvm/versions/node/v12.16.1/lib/node_modules/git-hours/node_modules/promisify-node/utils/args.js:9
var args = func.toString().match(/function\s.*?\(([^)]*)\)/)[1];
                                                             ^
marekyggdrasil commented 3 years ago

I found that node 10 was not supported (at least at some instance of time).

I decided to blindly try different versions of node and I accidentally made it work when I switched to node 6.0

$ nvm install 6.0

then I tried the installation again

$ npm install -g git-hours

and the output I got was a succeedo

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
/Users/marek/.nvm/versions/node/v6.0.0/bin/git-hours -> /Users/marek/.nvm/versions/node/v6.0.0/lib/node_modules/git-hours/src/index.js

> nodegit@0.13.2 install /Users/marek/.nvm/versions/node/v6.0.0/lib/node_modules/git-hours/node_modules/nodegit
> node lifecycleScripts/install

[nodegit] Fetching binary from S3.
[nodegit] Completed installation successfully.

> nodegit@0.13.2 postinstall /Users/marek/.nvm/versions/node/v6.0.0/lib/node_modules/git-hours/node_modules/nodegit
> node postinstall.js

/Users/marek/.nvm/versions/node/v6.0.0/lib
└─┬ git-hours@1.3.0 
  ├── bluebird@2.11.0 
  ├── commander@2.20.3 
  ├── lodash@2.4.2 
  ├── moment@2.29.1 
  └─┬ nodegit@0.13.2 
    ├─┬ fs-extra@0.26.7 
    │ ├── graceful-fs@4.2.6 
    │ ├── jsonfile@2.4.0 
    │ ├── klaw@1.3.1 
    │ ├── path-is-absolute@1.0.1 
    │ └─┬ rimraf@2.7.1 
    │   └─┬ glob@7.1.6 
    │     ├── fs.realpath@1.0.0 
    │     ├── inflight@1.0.6 
    │     ├─┬ minimatch@3.0.4 
    │     │ └─┬ brace-expansion@1.1.11 
    │     │   ├── balanced-match@1.0.0 
    │     │   └── concat-map@0.0.1 
    │     └── once@1.4.0 
    ├─┬ node-pre-gyp@0.6.28 
    │ ├─┬ mkdirp@0.5.5 
    │ │ └── minimist@1.2.5 
    │ ├─┬ nopt@3.0.6 
    │ │ └── abbrev@1.1.1 
    │ ├─┬ npmlog@2.0.4 
    │ │ ├── ansi@0.3.1 
    │ │ ├─┬ are-we-there-yet@1.1.5 
    │ │ │ ├── delegates@1.0.0 
    │ │ │ └─┬ readable-stream@2.3.7 
    │ │ │   ├── process-nextick-args@2.0.1 
    │ │ │   └── string_decoder@1.1.1 
    │ │ └─┬ gauge@1.2.7 
    │ │   ├── has-unicode@2.0.1 
    │ │   ├── lodash.pad@4.5.1 
    │ │   ├── lodash.padend@4.6.1 
    │ │   └── lodash.padstart@4.6.1 
    │ ├─┬ rc@1.1.7 
    │ │ ├── deep-extend@0.4.2 
    │ │ ├── ini@1.3.8 
    │ │ └── strip-json-comments@2.0.1 
    │ ├─┬ request@2.88.2 
    │ │ ├── aws-sign2@0.7.0 
    │ │ ├── aws4@1.11.0 
    │ │ ├── caseless@0.12.0 
    │ │ ├─┬ combined-stream@1.0.8 
    │ │ │ └── delayed-stream@1.0.0 
    │ │ ├── extend@3.0.2 
    │ │ ├── forever-agent@0.6.1 
    │ │ ├─┬ form-data@2.3.3 
    │ │ │ └── asynckit@0.4.0 
    │ │ ├─┬ har-validator@5.1.5 
    │ │ │ ├─┬ ajv@6.12.6 
    │ │ │ │ ├── fast-deep-equal@3.1.3 
    │ │ │ │ ├── fast-json-stable-stringify@2.1.0 
    │ │ │ │ ├── json-schema-traverse@0.4.1 
    │ │ │ │ └── uri-js@4.4.1 
    │ │ │ └── har-schema@2.0.0 
    │ │ ├─┬ http-signature@1.2.0 
    │ │ │ ├── assert-plus@1.0.0 
    │ │ │ ├─┬ jsprim@1.4.1 
    │ │ │ │ ├── extsprintf@1.3.0 
    │ │ │ │ ├── json-schema@0.2.3 
    │ │ │ │ └── verror@1.10.0 
    │ │ │ └─┬ sshpk@1.16.1 
    │ │ │   ├── asn1@0.2.4 
    │ │ │   ├── bcrypt-pbkdf@1.0.2 
    │ │ │   ├── dashdash@1.14.1 
    │ │ │   ├── ecc-jsbn@0.1.2 
    │ │ │   ├── getpass@0.1.7 
    │ │ │   ├── jsbn@0.1.1 
    │ │ │   ├── safer-buffer@2.1.2 
    │ │ │   └── tweetnacl@0.14.5 
    │ │ ├── is-typedarray@1.0.0 
    │ │ ├── isstream@0.1.2 
    │ │ ├── json-stringify-safe@5.0.1 
    │ │ ├─┬ mime-types@2.1.29 
    │ │ │ └── mime-db@1.46.0 
    │ │ ├── oauth-sign@0.9.0 
    │ │ ├── performance-now@2.1.0 
    │ │ ├── qs@6.5.2 
    │ │ ├── safe-buffer@5.1.2 
    │ │ ├─┬ tough-cookie@2.5.0 
    │ │ │ ├── psl@1.8.0 
    │ │ │ └── punycode@2.1.1 
    │ │ ├── tunnel-agent@0.6.0 
    │ │ └── uuid@3.4.0 
    │ ├── rimraf@2.5.4 
    │ ├── semver@5.1.1 
    │ ├─┬ tar@2.2.2 
    │ │ ├── block-stream@0.0.9 
    │ │ ├── fstream@1.0.12 
    │ │ └── inherits@2.0.4 
    │ └─┬ tar-pack@3.1.4 
    │   ├─┬ debug@2.2.0 
    │   │ └── ms@0.7.1 
    │   ├── fstream-ignore@1.0.5 
    │   ├─┬ once@1.3.3 
    │   │ └── wrappy@1.0.2 
    │   ├─┬ readable-stream@2.1.5 
    │   │ ├── buffer-shims@1.0.0 
    │   │ ├── core-util-is@1.0.2 
    │   │ ├── isarray@1.0.0 
    │   │ ├── process-nextick-args@1.0.7 
    │   │ ├── string_decoder@0.10.31 
    │   │ └── util-deprecate@1.0.2 
    │   ├── rimraf@2.5.4 
    │   └── uid-number@0.0.6 
    └─┬ promisify-node@0.3.0 
      └─┬ nodegit-promise@4.0.0 
        └── asap@2.0.6 

I am no node expert, I suspect something changed in how node works, probably the return type of match function so that there no longer is any returned list and thus no index at [1]. I don't know why... But I have my git-hours working now and I am happy.

mathieujobin commented 3 years ago

please fix this

MatthieuScarset commented 3 years ago

Error when trying to install via npm:

npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/git-hours/node_modules/nodegit
npm ERR! command failed
npm ERR! command sh -c node lifecycleScripts/install
npm ERR! /usr/local/lib/node_modules/git-hours/node_modules/promisify-node/utils/args.js:9
npm ERR!   var args = func.toString().match(/function\s.*?\(([^)]*)\)/)[1];
npm ERR!                                                               ^
npm ERR! 
npm ERR! TypeError: Cannot read property '1' of null
npm ERR!     at module.exports (/usr/local/lib/node_modules/git-hours/node_modules/promisify-node/utils/args.js:9:63)
npm ERR!     at /usr/local/lib/node_modules/git-hours/node_modules/promisify-node/index.js:79:29
npm ERR!     at Array.filter (<anonymous>)
npm ERR!     at processExports (/usr/local/lib/node_modules/git-hours/node_modules/promisify-node/index.js:60:6)
npm ERR!     at module.exports (/usr/local/lib/node_modules/git-hours/node_modules/promisify-node/index.js:112:10)
npm ERR!     at Object.<anonymous> (/usr/local/lib/node_modules/git-hours/node_modules/nodegit/generate/scripts/generateNativeCode.js:3:13)
npm ERR!     at Module._compile (internal/modules/cjs/loader.js:778:30)
npm ERR!     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
npm ERR!     at Module.load (internal/modules/cjs/loader.js:653:32)
npm ERR!     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
Ruin0x11 commented 3 years ago

Since the code for this tool was pretty simple, I decided to rewrite it in Rust.

The repository is here: https://github.com/Ruin0x11/jikyuu

kimmobrunfeldt commented 3 years ago

@Ruin0x11 awesome!

The tool is now installable with Node 14, tested on macOS.