You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error configuring libssh2 - cannot find OpenSSL or Libgcrypt #728
Running "npm install" (after clearing the node_modules directory), I get the following error when my module tries to install the NodeGit dependency (based on the Master branch with latest commit 330abdb on 17 Sep 2015).
[nodegit] Configuring libssh2.
{ [Error: Command failed: /Users/user1/Workspaces/modules/myModule/node_modules/nodegit/vendor/libssh2/configure
configure: error: cannot find OpenSSL or Libgcrypt,
try --with-libssl-prefix=PATH or --with-libgcrypt-prefix=PATH
]
It appears it can't find the OpenSSL libraries, but OpenSSL is present on my system at /usr/bin/openssl
My environment is:
Node v4.1.0
OS X 10.11 (El Capitan)
NPM v2.14.3 (as bundled with Node v 4.1.0)
OpenSSL v0.9.8zg (as bundled with OS X 10.11)
@saper was right, even with XCode 7 and the latest cli tools on El Capitan, I still had to brew install openssl and link it with brew link openssl --force for it to work.
In case you need a third confirmation, exact same experience (error with latest Xcode 7 command line tools installed), worked via @bmathews’s instructions (thanks!) :)
This seems to break again on linux using even newer versions.
On OSX, I have 1.0.2d (installed via brew) and the compile works.
On Alpine Linux, I have 1.0.2d and the compile fails with the exact same error.
I found the log file in /usr/src/app/node_modules/nodegit/vendor/libssh2/console.log, it's quite lengthly. Despite the process exiting 0, nothing is output, i.e. the Release and debug directories are empty. This is the log file - it's quite lengthly - and notes failure to find certain files. Log file below (github wouldn't let me attached it).
EDITED I would do what @bmathews suggest in his comment : brew link openssl --force
I wouldn't do what @bmathews suggest in his comment : brew link openssl --force
The brew guys had a reason to not link openssl by default, it's because it may break your OS, as it relies on this version.
@maxkorp I edited my answer, sorry typo ;)
Anyway thanks for the explanation. @johnhaley81's answer in #753 about upgrading to version 0.6.0 solves the issue without that brew trick.
Ubuntu 16.04 needs sudo apt install libssl-dev then good to go.
Reacted by Brian Vanderbusch, Peter Gafert, Hossein Pursultani, Alex Katopodis, Pietro Paolo Vismara, Jiri Spac, Graham McGregor and Aleksandr Kovalchuk
I have this problem on Ubuntu 17.04, libssl, libssl-dev and gcc are all already installed. Any other potential dependencies that might be blocking nodegit's libssh2 installation?
Activity
saper commentedon Sep 19, 2015
Can you try to get the
config.logfile? (Probably you need to check nodegit out of git and runnpm installin the checked-out directory).ChrisPearce commentedon Sep 19, 2015
Thanks for the advice of looking in the config.log file.
I've resolved the problem by installing the latest version of XCode 7 and also the latest version of the command line tools.
saper commentedon Sep 19, 2015
Most probably your OpenSSL version was too old. Good that you can compile nodegit now!
bmathews commentedon Sep 28, 2015
@saper was right, even with XCode 7 and the latest cli tools on El Capitan, I still had to
brew install openssland link it withbrew link openssl --forcefor it to work.SebastianSchenk commentedon Oct 5, 2015
@bmathews answer worked for me!
thomasjonas commentedon Oct 9, 2015
@bmathews Thanks, that fixed my problem too!
aral commentedon Oct 12, 2015
In case you need a third confirmation, exact same experience (error with latest Xcode 7 command line tools installed), worked via @bmathews’s instructions (thanks!) :)
samkelleher commentedon Nov 3, 2015
This seems to break again on linux using even newer versions.
On OSX, I have
1.0.2d(installed via brew) and the compile works.On Alpine Linux, I have
1.0.2dand the compile fails with the exact same error.saper commentedon Nov 3, 2015
Is there a
config.logfile you can post?samkelleher commentedon Nov 3, 2015
Cheers @saper - I'm looking for the
config.log- where is it located?saper commentedon Nov 3, 2015
Try:
find /usr/src/app/node_modules/nodegit -name config.log
samkelleher commentedon Nov 4, 2015
I found the log file in
/usr/src/app/node_modules/nodegit/vendor/libssh2/console.log, it's quite lengthly. Despite the process exiting0, nothing is output, i.e. the Release and debug directories are empty. This is the log file - it's quite lengthly - and notes failure to find certain files. Log file below (github wouldn't let me attached it).bric3 commentedon Dec 10, 2015
EDITED
I would do what @bmathews suggest in his comment :brew link openssl --forceI wouldn't do what @bmathews suggest in his comment :
brew link openssl --forceThe brew guys had a reason to not link openssl by default, it's because it may break your OS, as it relies on this version.
maxkorp commentedon Dec 11, 2015
Yup, apple stopped bundling openssl headers (they use a new tls lib) on el capitan
bric3 commentedon Dec 12, 2015
@maxkorp I edited my answer, sorry typo ;)
Anyway thanks for the explanation. @johnhaley81's answer in #753 about upgrading to version 0.6.0 solves the issue without that
brewtrick.n8behavior commentedon Sep 14, 2016
Ubuntu 16.04 needs
sudo apt install libssl-devthen good to go.📚 add info about possible libssl-dev dependency
namel commentedon May 22, 2017
The usual fix didn't work for me. I am on Ubuntu 16.04, I ran
sudo apt install libssl-devwhich installed version1.0.2g-1ubuntu4.6.But when I try to install nodegit it fails. I fixed this by adding gcc:
sudo apt install -y gccjoncamfield commentedon Jul 24, 2017
I have this problem on Ubuntu 17.04, libssl, libssl-dev and gcc are all already installed. Any other potential dependencies that might be blocking nodegit's libssh2 installation?
gihook commentedon Apr 9, 2018
I had the same problem on Fedora. Fixed it by installing openssl-devel. My bet is that it will work on CentOS as well.
alias137 commentedon Nov 22, 2019
I can confirm (on CentOS 8) that after I've installed openssl-devel worked.
Thanks