kimmobrunfeldt / git-hours

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

npm install failed on MacOS HighSierra 10.13.3 #34

Closed alichtman closed 3 years ago

alichtman commented 6 years ago
$ npm install -g git-hours
[1]  + 44543 suspended (signal)  npm install -g git-hoursModule git-hours@1.3.0 checking
/usr/local/bin/git-hours -> /usr/local/lib/node_modules/git-hours/src/index.js

> nodegit@0.13.2 install /usr/local/lib/node_modules/git-hours/node_modules/nodegit
> node lifecycleScripts/install

[nodegit] Fetching binary from S3.
[nodegit] Failed to install prebuilt binary:
{ Error: Command failed: "/usr/local/lib/node_modules/git-hours/node_modules/nodegit/node_modules/.bin/node-pre-gyp" install --fallback-to-build=false
node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ '/usr/local/Cellar/node/9.11.1/bin/node',
node-pre-gyp verb cli   '/usr/local/lib/node_modules/git-hours/node_modules/nodegit/node_modules/.bin/node-pre-gyp',
node-pre-gyp verb cli   'install',
node-pre-gyp verb cli   '--fallback-to-build=false' ]
node-pre-gyp info using node-pre-gyp@0.6.28
node-pre-gyp info using node@9.11.1 | darwin | x64
node-pre-gyp verb command install []
node-pre-gyp info check checked for "/usr/local/lib/node_modules/git-hours/node_modules/nodegit/build/Release/nodegit.node" (not found)
node-pre-gyp http GET https://nodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.13.2-node-v59-darwin-x64.tar.gz
node-pre-gyp http 403 https://nodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.13.2-node-v59-darwin-x64.tar.gz
node-pre-gyp ERR! install error 
node-pre-gyp ERR! stack Error: 403 status code downloading tarball https://nodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.13.2-node-v59-darwin-x64.tar.gz
node-pre-gyp ERR! stack     at Request.<anonymous> (/usr/local/lib/node_modules/git-hours/node_modules/nodegit/node_modules/node-pre-gyp/lib/install.js:101:37)
node-pre-gyp ERR! stack     at Request.emit (events.js:185:15)
node-pre-gyp ERR! stack     at Request.onRequestResponse (/usr/local/lib/node_modules/git-hours/node_modules/request/request.js:1068:10)
node-pre-gyp ERR! stack     at ClientRequest.emit (events.js:180:13)
node-pre-gyp ERR! stack     at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:540:21)
node-pre-gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:117:17)
node-pre-gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:445:20)
node-pre-gyp ERR! stack     at TLSSocket.emit (events.js:180:13)
node-pre-gyp ERR! stack     at addChunk (_stream_readable.js:274:12)
node-pre-gyp ERR! stack     at readableAddChunk (_stream_readable.js:261:11)
node-pre-gyp ERR! System Darwin 17.4.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/9.11.1/bin/node" "/usr/local/lib/node_modules/git-hours/node_modules/nodegit/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build=false"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/git-hours/node_modules/nodegit
node-pre-gyp ERR! node -v v9.11.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.28
node-pre-gyp ERR! not ok 

    at ChildProcess.exithandler (child_process.js:273:12)
    at ChildProcess.emit (events.js:180:13)
    at maybeClose (internal/child_process.js:936:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
  killed: false,
  code: 1,
  signal: null,
  cmd: '"/usr/local/lib/node_modules/git-hours/node_modules/nodegit/node_modules/.bin/node-pre-gyp" install --fallback-to-build=false' }
[nodegit] Building manually. (You'll be here a while.)
[nodegit] Regenerating and configuring code

$ git-hours
internal/modules/cjs/loader.js:550
    throw err;
    ^

Error: Cannot find module '../build/Debug/nodegit.node'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.Module._load (internal/modules/cjs/loader.js:475:25)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/git-hours/node_modules/nodegit/dist/nodegit.js:18:12)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/git-hours/src/index.js:4:11)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)

System Information

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.3
BuildVersion:   17D102

$ node -v
v9.11.1
TobyMellor commented 6 years ago

Same error, same macOS version

module.js:545
    throw err;
    ^

Error: Cannot find module '../build/Debug/nodegit.node'
    at Function.Module._resolveFilename (module.js:543:15)
    at Function.Module._load (module.js:470:25)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/git-hours/node_modules/nodegit/dist/nodegit.js:18:12)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/git-hours/src/index.js:4:11)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
ChristianOrrala commented 6 years ago

node-pre-gyp ERR! stack Error: 403 status code downloading tarball https://nodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.13.2-node-v59-darwin-x64.tar.gz

Seems like the file it's not publicly available

ajoslin103 commented 6 years ago

Same installation, ending with (which seems to indicate installed ok) [nodegit] Building manually. (You'll be here a while.) [nodegit] Regenerating and configuring code

but Same error Error: Cannot find module '../build/Debug/nodegit.node'

So I tried installing nodegit on it's own (to get a more recent version) and it complained (with this most relevant line): /usr/local/lib/node_modules/nodegit/vendor/libssh2/missing: Unknown `--is-lightweight' option

the libssh2 repo says to update the OSX cmdLine tools w/sudo xcode-select --install

That allowed me to install nodegit - but the git-hours repo won't use it, it tries to build it's own and then symlink it's internal copy into the main /usr/local/lib/node_modules folder !!

argh!!

Graystripe17 commented 6 years ago

Same here. Any work around?

ajoslin103 commented 6 years ago

gtm (git-time-metrics)

and the maintainer of that package is looking at putting the git-hours capability into his package

Al;

- Here & Now    

On May 17, 2018, at 5:56 PM, Winston Van notifications@github.com wrote:

Same here. Any work around?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kimmobrunfeldt/git-hours/issues/34#issuecomment-390026241, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbF9bS4QSFJGs28EfgWqNAe1H9-ksHQks5tzfH3gaJpZM4TWKQv.

ruucm commented 6 years ago

I had the exact same issue.

So I directly put copy nodegit.node file to '../build/Debug/nodegit.node'

(files from '/usr/local/lib/node_modules/nodegit/build/Release/nodegit.node' - npm global repo)

Then it works like charm !

breck7 commented 6 years ago

@ruucm solution worked for me on Ubuntu 16.

I installed nodegit with npm install -g nodegit. I ran into a number of errors on a new Ubuntu 16 image. I had to first install typical dev libs (ssl, curl, other build tools). Then I needed to install n and use that to switch to node v6.14.4. Once I got nodegit installed, I did:

sudo mkdir -p /usr/local/lib/node_modules/git-hours/node_modules/nodegit/build/Release/

and then

sudo cp /usr/local/lib/node_modules/nodegit/build/Release/nodegit.node /usr/local/lib/node_modules/git-hours/node_modules/nodegit/build/Release/

balmasi commented 5 years ago

I got it working by first installing nodegit separately and then doing cp ~/.nvm/versions/node/v10.8.0/lib/node_modules/nodegit/build/Release/nodegit.node ~/.nvm/versions/node/v10.8.0/lib/node_modules/git-hours/node_modules/nodegit/build/Release

I'm using nvm so that's where my node packages get installed but you can copy from wherever you find nodegit.node to wherever git-hours looks for it

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.