Reputation: 79686
I have installed libssl-dev and openssl but I get this when I install node.js:
> ./configure && make && make install
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc or cc : /usr/bin/gcc
Checking for gcc : ok
Checking for library dl : yes
Checking for openssl : not found
Checking for function SSL_library_init : yes
Checking for header openssl/crypto.h : yes
Checking for library rt : yes
Checking for fdatasync(2) with c++ : yes
Openssl is not found. But node was installed successfully.
Why isn't openssl found? Anyone has the same problem?
Upvotes: 43
Views: 33243
Reputation: 11271
Seems like I can do:
apt-get install lib32z1-dev
apt-get install pkg-config
to consistently remove all errors and warnings about openssl when I'm doing a fresh Rackspace deployment with Ubuntu 11.04 or 11.10, in case that helps anyone else out.
Here's a gist with a rundown of the script I finally settled on for spinning up these types of instances with node.js:
https://gist.github.com/1606102
Edit: Updated the gist to reflect the updates made to Node, etc.
Upvotes: 3
Reputation: 1539
To solve this issue in Ubuntu 12.04:
apt-get install pkg-config -y
Upvotes: 2
Reputation: 2359
For people with a new Debian 6.0 (to be more precise: Debian 6.0.2.1 i386) set up, the following packages need to be installed to run node.js v.0.6.15 (latest stable at the moment): - build-essentials - pkg-config - libssl-dev
Just use aptitude -y install "package" ... hope that helps for all you Debian guys. :)
Upvotes: 1
Reputation: 111
I had the same problem.
I tried
./configure --prefix=/opt/node --openssl-libpath=/usr/local/lib/
which solved it even though I think --openssl-libpath=/usr/local/lib/
isn`t necessary
Upvotes: 3
Reputation: 473
['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/usr/sfw/lib']
;./configure --openssl-libpath=/usr/local/ssl/lib --openssl-includes=/usr/local/ssl/include
Upvotes: 3
Reputation: 512
I Had the same problem using Debian 6. I had to install libcurl4-openssl-dev.
Switch to root user, or use sudo, then run:
apt-get install libcurl4-openssl-dev
This fixed the problem for me.
Upvotes: 26
Reputation: 1293
If using Centos 5.x, make sure that you install openssl-devel prior to ./configure.
yum install openssl-devel
This solved the same issue for me in centos.
Upvotes: 10
Reputation: 499
@weng: I had the same problem. The solution was easy: sudo apt-get install pkg-config :)
Upvotes: 49
Reputation: 6469
This isn't exactly a programming question. Still...
The installer checks for OpenSSL support in two ways. The first check failed for you, the second succeeded. For me, the first check succeeded (see below). Either way works.
Here's what I got when I built it:
$ sudo apt-get install libssl-dev
$ ./configure
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc or cc : /usr/bin/gcc
Checking for gcc : ok
Checking for library dl : yes
Checking for openssl : yes
Checking for library rt : yes
<---snip--->
Presuming you downloaded node.js v0.2.3 from http://nodejs.org/, the configuration is mostly done by waf in the file wscript.
The relevant lines are:
if not Options.options.without_ssl:
if conf.check_cfg(package='openssl',
args='--cflags --libs',
uselib_store='OPENSSL'):
Options.options.use_openssl = conf.env["USE_OPENSSL"] = True
conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1")
else:
libssl = conf.check_cc(lib='ssl',
header_name='openssl/ssl.h',
function_name='SSL_library_init',
libpath=['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/usr/sfw/lib'],
uselib_store='OPENSSL')
libcrypto = conf.check_cc(lib='crypto',
header_name='openssl/crypto.h',
uselib_store='OPENSSL')
The first part is simple enough. It runs pkgconfig. Here is what happens when I do the equivalent by hand:
$ pkg-config openssl --cflags --libs
-lssl -lcrypto
The second set of checks is run if pkg-config fails to confirm the package is installed. In that case, it tries to compile a trivial gcc program which checks for the existence of functions in libcrypt and libssl. If those both succeed, installation continues. If one of them fails, there's a fatal error, and the script bombs out.
Upvotes: 33