node包管理器安装和配置

node包管理器安装和配置
Starnpm
配置镜像
bash
1 | npm config set registry https://registry.npmmirror.com |
查询npm镜像
bash
1 | npm get registry |
cnpm
安装cnpm
bash
1 | npm install -g cnpm --registry=https://registry.npmmirror.com |
yarn
安装yarn
bash
1 | npm install -g yarn |
配置镜像
bash
1 | yarn config set registry https://registry.npmmirror.com |
查看配置列表
shell
1 | yarn config list |
配置全局安装目录和缓存目录
shell
1 | 全局bin目录 |
查询是否配置成功
shell
1 | 查看全局bin目录 |
pnpm
安装pnpm
bash
1 | npm install -g pnpm |
配置镜像
bash
1 | pnpm config set registry https://registry.npmmirror.com |
配置全局安装目录和缓存目录
shell
1 | 允许设置全局安装包的 bin 文件的目标目录。 |
查询是否配置成功
shell
1 | 查看全局bin目录 |