Skip to content

Nodejs

NPM 镜像源

sh
# 新镜像源
npm config set registry https://registry.npmmirror.com

pnpm 清除缓存

sh
npm config get cache
npm cache clean --force
npm cache verify

pnpm 清除缓存

sh
pnpm store path
pnpm store prune

yarn 清除缓存

sh
yarn cache dir
yarn cache clean
# 检查当前 yarn 的 全局安装位置
yarn global dir
# 检查当前yarn 的 bin的 位置
yarn global dir
# 查看 yarn 全局cache位置
yarn cache dir

NPM 查看 prefix 的方法

sh
npm config list

NPM 修改库文件存放目录

js
npm config set prefix "D:\nodeCache\lib_global"

NPM 修改库文件缓存目录

js
npm config set cache "D:\nodeCache\lib_cache"

NPM 修改代理位置(视工作环境而定)

js
npm config set proxy ""