报错:
Could not retrieve https://npm.taobao.org/mirrors/node/latest/SHASUMS256.txt.
Get “https://npm.taobao.org/mirrors/node/latest/SHASUMS256.txt”: x509: certificate has expired or is not yet valid:
分析原因:
这其实是因为官方的镜像地址更新,而咱们使用的本地配置的地址未更新导致的,需要更新配置到以下新地址
node_mirror: https://npmmirror.com/mirrors/node/
npm_mirror: https://npmmirror.com/mirrors/npm/
尝试解决:
npm config (回车)
由于npm镜像地址更新,所以这里我们分别要更新node镜像地址和npm镜像地址,会使用到以下命令:
nvm node_mirror [url] : Set the node mirror. Defaults to https://nodejs.org/dist/. Leave [url] blank to use default url.
nvm npm_mirror [url] : Set the npm mirror. Defaults to https://github.com/npm/cli/archive/. Leave [url] blank to default url.
在配置之前我们也可以先清空一下缓存
npm cache clean --force
依次键入指令,回车
nvm node_mirror https://npmmirror.com/mirrors/node/
nvm npm_mirror https://npmmirror.com/mirrors/npm/
大功告成!