Skip to content

npm指定镜像源安装依赖

  • 使用 --registry 参数

    shell
    npm install 依赖 --registry=镜像源地址
  • 在项目根目录下创建 .npmrc 文件,添加以下内容

    image-20250621214642562

    shell
    registry=镜像源地址
  • 全局配置更改默认源

    shell
    npm config set registry 镜像源

MIT版权,未经许可禁止任何形式的转载