在猫盘上使用n模块安装node最新版本时发现提示
curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option. Error: failed to download version index (https://nodejs.org/dist/index.tab)
谷歌一番后发现是没有证书文件导致的,下面是解决过程
一.挂载/为读写
mount -o remount,rw /
二.下载需要的证书文件并解压
wget -O /tmp/ca-certificates.zip https://down.b1ue.me/d/CatDrive_X3P/ca-certificates.zip
unzip /tmp/ca-certificates.zip -d /usr/share/
rm -f /tmp/ca-certificates.zip
三.下载c_rehash、update-ca-certificates并赋予可执行权限
wget -O /usr/bin/c_rehash https://down.b1ue.me/d/CatDrive_X3P/c_rehash
chmod 755 /usr/bin/c_rehash
wget -O /usr/sbin/update-ca-certificates https://down.b1ue.me/d/CatDrive_X3P/update-ca-certificates
chmod 755 /usr/sbin/update-ca-certificates
四.更新证书链
update-ca-certificates
c_rehash /etc/ssl/certs
五.问题解决,将/挂载回只读
mount -o remount,ro /