yarn

创建日期:2024-06-21
更新日期:2024-12-27

配置文件

在 C:\Users\liteng 目录下创建文件 .yarnrc ,填写以下内容:

# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1

registry "https://registry.npmmirror.com"
ELECTRON_MIRROR "https://registry.npmmirror.com/electron"
cache-folder "D:\\temp\\yarn\\cache"
disturl "https://registry.npmmirror.com/node"
global-folder "D:\\temp\\yarn\\global"
prefix "D:\\temp\\yarn"

常见问题

1、(node:23212) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 upgrade listeners added to [Server]. Use emitter.setMaxListeners() to increase limit。

解决方法:

2、yarn install时报错:info There appears to be trouble with your network connection. Retrying...。

解决方法:执行以下代码即可。

yarn cache clean -f

3、yarn install报错: error @achrinza/node-ipc@9.2.2: The engine "node" is incompatible with this module. Expected version "8 || 10 || 12 || 14 || 16 || 17". Got "20.10.0"。

yarn install --ignore-engines

4、yarn install报错:error commander@12.1.0: The engine "node" is incompatible with this module. Expected version ">=18". Got "16.20.2"。

yarn install --ignore-engines