Yarn 包管理工具经验
.yarnrc
配置文件
.yarnrc
配置文件在 Windows 平台下的路径为 C:\Users\用户名\.yarnrc
,在 Linux 平台下的路径为 ~/.yarnrc
。参考以下配置:
# 华为镜像
registry "https://mirrors.huaweicloud.com/repository/npm/"
# 华为镜像
disturl "https://mirrors.huaweicloud.com/nodejs/"
# 缓存
cache-folder "D:\\dev\\yarn-cache"
# 全局安装路径
global-folder "D:\\dev\\yarn-global"
# 是否启用 https
strict-ssl false
证书过期问题
在使用 yarn
命令安装依赖包时,报 certificate has expired
错误
PS D:\3examples\utils> yarn
yarn install v1.22.22
info No lockfile found.
[1/4] Resolving packages...
error Error: certificate has expired
at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)
at TLSSocket.emit (node:events:519:28)
at TLSSocket._finishInit (node:_tls_wrap:1085:8)
at ssl.onhandshakedone (node:_tls_wrap:871:12)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
info There appears to be trouble with your network connection. Retrying...