切换npm 国内镜像与国外镜像

1, 修改 下载仓库为淘宝镜像

  npm config set registry https://registry.npm.taobao.org --global

  npm config set disturl https://npm.taobao.org/dist --global

2, 如果要发布自己的镜像需要修改回来

  npm config set registry https://registry.npmjs.org/

3, 安装cnpm

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

4,查看当前地址

  npm config list

5,npm的命令

  - npm -v 查看npm的版本
  - npm version 查看所有模块的版本
  - npm search 包名 搜索包
  - npm install / i 包名 安装包
  - npm remove / r 包名 删除包
  - npm install 包名 --save 安装包并添加到依赖中 *****
  - npm install 下载当前项目所依赖的包
  - npm install 包名 -g 全局安装包(全局安装的包一般都是一些工具)
posted @ 2020-09-08 15:37  有糖不给你  阅读(811)  评论(0编辑  收藏  举报