前端学习记录006_npm命令行、nrm仓库管理以及cnpm(windows版)

一、npm相关命令

1.1 查看npm全局配置信息

npm config get

1.2 查看npm当前使用的仓库地址

npm config get registry

1.3 指定本次下载依赖要使用的地址

npm install --registry=https://registry.npm.taobao.org/ 

1.4 配置全局npm仓库

npm config set registry http://registry.npm.taobao.org/    

1.5 配置文件内容

配置文件可以通过 查看全局配置来获取

二、使用nrm管理npm仓库地址

2.1 安装nrm

npm install -g nrm # 可以通过 --registry=https://registry.npm.taobao.org 配置下载镜像

2.2 查看可以使用的仓库地址

nrm ls

2.3 add或del仓库

#添加仓库地址
nrm add 仓库名 地址 # 例如:nrm add myrepos http://www.baidu.com
#删除仓库地址
nrm del 仓库名   # 例如:nrm del myrepos

2.4 切换仓库地址

nrm use 仓库名

三、使用cnpm代替npm

3.1 安装

npm install -g cnpm --registry=https://registry.npm.taobao.org

3.2 cnpm命令

将npm开头的命令行,换成cnpm开头就可以了

猜你喜欢

转载自blog.csdn.net/Duckdan/article/details/114727760