npm: relocation error: npm: symbol SSL_set_cert_cb, version libssl.so.10 not defined in file libssl.
参考:
1.https://stackoverflow.com/questions/46473376/node-relocation-error-node-symbol-ssl-set-cert-cb-version-libssl-so-10-not-d
2.https://www.cnblogs.com/hsia2017/p/8387604.html
环境:Centos 7
[root@test1280 ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
[root@test1280 ~]# uname -a
Linux test1280 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@test1280 ~]# npm -v
3.10.10
[root@test1280 ~]# node -v
v6.17.1
重现:npm install -g http-server
[root@test1280 ~]# npm install -g http-server
npm: relocation error: npm: symbol SSL_set_cert_cb, version libssl.so.10 not defined in file libssl.so.10 with link time reference
解决:升级openssl库 yum update openssl -y
[root@test1280 ~]# yum update openssl -y
……
[root@test1280 ~]# npm install -g http-server
/usr/bin/http-server -> /usr/lib/node_modules/http-server/bin/http-server
/usr/bin/hs -> /usr/lib/node_modules/http-server/bin/http-server
/usr/lib
└─┬ http-server@0.11.1
├── colors@1.0.3
├── corser@2.0.1
├─┬ ecstatic@3.3.2
│ ├── he@1.2.0
│ ├── mime@1.6.0
│ ├── minimist@1.2.0
│ └── url-join@2.0.5
├─┬ http-proxy@1.18.0
│ ├── eventemitter3@4.0.0
│ ├── follow-redirects@1.9.0
│ └── requires-port@1.0.0
├── opener@1.4.3
├─┬ optimist@0.6.1
│ ├── minimist@0.0.10
│ └── wordwrap@0.0.3
├─┬ portfinder@1.0.25
│ ├─┬ async@2.6.3
│ │ └── lodash@4.17.15
│ ├─┬ debug@3.2.6
│ │ └── ms@2.1.2
│ └─┬ mkdirp@0.5.1
│ └── minimist@0.0.8
└─┬ union@0.4.6
└── qs@2.3.3
[root@test1280 ~]# openssl version
OpenSSL 1.0.2k-fips 26 Jan 2017