目录
1、查看版本
npm -v

2、 配置相关
2.1查看npm配置信息
npm config list

2.2获取某一项配置
npm config get xxx
比如:

2.3配置使用国内仓库地址
第一种:使用cnpm代替npm
第二种:修改npm仓库的地址
查看npm仓库原来的地址:npm config get registry

修改npm仓库的地址:npm config set registry 地址
这里我们把npm仓库地址修改成淘宝镜像
npm的镜像地址有以下几个:
1. 官方镜像:https://registry.npmjs.org/
2. 淘宝镜像:https://registry.npm.taobao.org/
3. cnpm镜像:https://r.cnpmjs.org/
4. 阿里云镜像:https://npm.aliyun.com/
5. 中国科技大学镜像:https://mirrors.ustc.edu.cn/npm/
6. 华为云镜像:https://mirrors.huaweicloud.com/repository/npm/
3、npm install 包名
默认本地安装,想要全局安装需要加上 “-g ”
3740





