Ubuntu-reason: certificate has expired

Ubuntu-reason: certificate has expired解决方法

//安装报错无法连接到服务器:
root@ok3568:/home/forlinx/3ddemo/3ddemo# npm install -g http-server
npm ERR! network timeout at: https://registry.npmjs.org/http-server
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2038-05-08T10_41_44_723Z-debug.log

//解决方法:
root@ok3568:/home/forlinx/3ddemo/3ddemo# npm config set registry https://registry.npm.taobao.org/
root@ok3568:/home/forlinx/3ddemo/3ddemo# export http_proxy=http://host.resona.top:9590                                   
root@ok3568:/home/forlinx/3ddemo/3ddemo# export https_proxy=http://host.resona.top:9590
root@ok3568:/home/forlinx/3ddemo/3ddemo# npm install -g http-server
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/http-server failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2038-05-08T10_43_11_679Z-debug.log

证书过期问题:
root@ok3568:/home/forlinx/3ddemo/3ddemo# npm install -g http-server
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/http-server failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2038-05-08T10_45_03_437Z-debug.log

//解决方法:
root@ok3568:/home/forlinx/3ddemo/3ddemo# npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
root@ok3568:/home/forlinx/3ddemo/3ddemo# npm config set strict-ssl false
root@ok3568:/home/forlinx/3ddemo/3ddemo# npm install
npm WARN saveError ENOENT: no such file or directory, open '/home/forlinx/3ddemo/3ddemo/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/forlinx/3ddemo/3ddemo/package.json'
npm WARN 3ddemo No description
npm WARN 3ddemo No repository field.
npm WARN 3ddemo No README data
npm WARN 3ddemo No license field.
up to date in 1.731s

//安装所需软件
root@ok3568:/home/forlinx/3ddemo/3ddemo# npm install -g http-server
/usr/local/bin/http-server -> /usr/local/lib/node_modules/http-server/bin/http-server
npm WARN notsup Unsupported engine for http-server@14.1.1: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: http-server@14.1.1
npm WARN notsup Unsupported engine for html-encoding-sniffer@3.0.0: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: html-encoding-sniffer@3.0.0
npm WARN notsup Unsupported engine for whatwg-encoding@2.0.0: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: whatwg-encoding@2.0.0
+ http-server@14.1.1
added 44 packages from 42 contributors in 111.782s
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Paper_Love

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值