nodegit: Can't install via NPM

Am I missing something? Any tips how to get around this? It just started happening.

> nodegit@0.16.0 install /Users/superman/Sites/myproj/node_modules/nodegit
> node lifecycleScripts/preinstall && node lifecycleScripts/install

[nodegit] Running pre-install script
[nodegit] Configuring libssh2.
{ [Error: Command failed: /bin/sh -c /Users/superman/Sites/myproj/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/Users/superman/Sites/myproj/node_modules/nodegit/vendor/openssl/openssl
/Users/superman/Sites/myproj/node_modules/nodegit/vendor/libssh2/missing: Unknown `--is-lightweight' option
Try `/Users/superman/Sites/myproj/node_modules/nodegit/vendor/libssh2/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: No crypto library found!
Try --with-libssl-prefix=PATH
 or --with-libgcrypt-prefix=PATH
 or --with-wincng on Windows
]
  killed: false,
  code: 1,
  signal: null,
  cmd: '/bin/sh -c /Users/superman/Sites/myproj/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/Users/superman/Sites/myproj/node_modules/nodegit/vendor/openssl/openssl' }
/Users/superman/Sites/myproj/node_modules/nodegit/vendor/libssh2/missing: Unknown `--is-lightweight' option
Try `/Users/superman/Sites/myproj/node_modules/nodegit/vendor/libssh2/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: No crypto library found!
Try --with-libssl-prefix=PATH
 or --with-libgcrypt-prefix=PATH
 or --with-wincng on Windows

[nodegit] ERROR - Could not finish preinstall
{ [Error: Command failed: /bin/sh -c /Users/superman/Sites/myproj/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/Users/superman/Sites/myproj/node_modules/nodegit/vendor/openssl/openssl
/Users/superman/Sites/myproj/node_modules/nodegit/vendor/libssh2/missing: Unknown `--is-lightweight' option
Try `/Users/superman/Sites/myproj/node_modules/nodegit/vendor/libssh2/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: No crypto library found!
Try --with-libssl-prefix=PATH
 or --with-libgcrypt-prefix=PATH
 or --with-wincng on Windows
]
  killed: false,
  code: 1,
  signal: null,
  cmd: '/bin/sh -c /Users/superman/Sites/myproj/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/Users/superman/Sites/myproj/node_modules/nodegit/vendor/openssl/openssl' }
myproj-server@1.0.0 /Users/superman/Sites/myproj
└── (empty)

npm WARN EPACKAGEJSON myproj-server@1.0.0 No repository field.
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/Users/superman/npm/bin/npm" "install" "nodegit" "--save"
npm ERR! node v4.4.7
npm ERR! npm  v3.3.10
npm ERR! code ELIFECYCLE

npm ERR! nodegit@0.16.0 install: `node lifecycleScripts/preinstall && node lifecycleScripts/install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the nodegit@0.16.0 install script 'node lifecycleScripts/preinstall && node lifecycleScripts/install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the nodegit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node lifecycleScripts/preinstall && node lifecycleScripts/install
npm ERR! You can get their info via:
npm ERR!     npm owner ls nodegit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/superman/Sites/myproj/npm-debug.log
npm ERR! code 1

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 15
  • Comments: 35 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Latest Xcode just straight up broke things all across the world. Try running sudo xcode-select --install and update the xcode CLT. That fixed it for me.

Since this issue popped up first, when I searched for this error: On Ubuntu 16.04 this problem might be solved by sudo apt install libssl-dev (thanks to @n8behavior) See #728

Latest Xcode just straight up broke things all across the world. Try running sudo xcode-select --install and update the xcode CLT. That fixed it for me.

This fix worked for me on macOS Sierra, but after upgrading to macOS Mojave this fix does not work anymore.

brew install libgcrypt did fixed this issue though. I will test this a bit alter on clean macOS Mojave clean install. But as for now it looks like that nodegit is not working on Mojave by default, except libgcrypt is installed with brew.

Should documentation be updated for this? Better yet, is there a node crypto library that nodegit could fall back on if libssl-dev isn’t present?

yum groupinstall "Development tools" no workie on Amazon Linux.

yum install openssl-devel DID work on Amazon Linux! Yaye!

On Ubuntu 18.04 I got the error:

WARN Tried to download(404): https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.26.3-node-v79-linux-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for nodegit@0.26.3 and node@13.3.0 (node-v79 ABI, glibc) (falling back to source compile with node-gyp)
/bin/sh: 1: krb5-config: not found
gyp: Call to 'krb5-config gssapi --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp
ERR! configure error

my solution was:

 sudo apt install libkrb5-dev

Happens for me as well on Mac OS Sierra 10.12.1. sudo xcode-select --install gives me:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

App Store tells me XCode is up to date though.

Thanks man!

Yeah one of the major os versions made that insufficient (El Capitan maybe? Yosemite? I don’t recall).

Can you try installing nodegit@0.23.0-alpha.1?

On Ubuntu 16.04, I was able to sudo apt-get install libssl-dev to progress somewhat further before I got hit by another error called curl/curl.h: No such file or directory, but then I sudo apt-get install libcurl4-openssl-dev and the thing managed to finally install.

I’m trying to get this to run on CentOS and am running into the same issue. I can’t install libssl-dev because it doesn’t exist for CentOS, and installing openssl-devel does not fix the problem. I’d love to use NodeGit, but this is obviously a blocker =/.

EDIT: The fix for CentOS is to run yum groupinstall "Development tools"

The issue lies in the fact that it will only use the included openssl if that copy is already built, but that copy is built by the install. Something of a chicken and egg problem that needs to be resolved first. Haven’t quite figured out a way around it yet though. Fixing that will allow it to use the locally included copy and should take care of that issue.

installing libssl-dev on ubuntu 16.10 also solved problem for me.