npm
# 查询依赖安装路径前缀npm prefix -g# 修改 npm 安装路径前缀npm config set prefix "xxxx"# 修改 cache 路径npm config set cache "xxx"
yarn
# 查询依赖安装路径(通过找 bin 目录来找依赖路径)yarn global bin# 修改安装路径前缀yarn config set prefix "xxx"# 修改 global 安装路径yarn config set global-folder "xxx"# 修改 cache 路径yarn config set cache-folder "xxx"
