报错request to https://registry.npm.taobao.org/typescript failed, reason: certificate has expired

在使用npm下载依赖的时候出现淘宝镜像证书过期问题:

npm ERR! request to https://registry.npm.taobao.org/typescript failed, reason: certificate has expired

其原因是官方修改了淘宝镜像源的地址,不管通过npm安装什么都会导致报错

解决办法:

切换淘宝最新镜像地址,执行完成之后就可以正常下载依赖了

npm config set registry https://registry.npmmirror.com

 再有报错npm ERR! errno -4048的话:
1.1 以管理员身份运行 Windows PowerShell
1.2 执行以下命令,更改权限为A,然后重试
set-ExecutionPolicy RemoteSigned

报错request to https://registry.npm.taobao.org/typescript failed, reason: certificate has expired_第1张图片

重试下ok

报错request to https://registry.npm.taobao.org/typescript failed, reason: certificate has expired_第2张图片

你可能感兴趣的:(node.js,typescript,npm,前端)