使用国内的 npm 镜像源可以加快安装和更新依赖包的速度。以下是一些常用的 npm 镜像源:

  1. 淘宝 NPM 镜像:https://registry.npm.taobao.org/

    • 设置方法:在终端中运行 npm config set registry https://registry.npm.taobao.org/
  2. cnpm(淘宝镜像的命令行工具):https://github.com/cnpm/cnpm

    • 安装方法:在终端中运行 npm install -g cnpm --registry=https://registry.npm.taobao.org
    • 设置方法:在终端中运行 cnpm install
  3. npm 官方中国镜像:https://registry.npmjs.org/

    • 设置方法:在终端中运行 npm config set registry https://registry.npmjs.org/

在使用这些镜像源时,可以使用 npm install 命令来安装依赖包,npm 会自动使用设置的镜像源进行下载

npm 源镜像 快

原文地址: https://www.cveoy.top/t/topic/iptQ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录