美文网首页
Nnpm使用国内镜像加速的几种方法

Nnpm使用国内镜像加速的几种方法

作者: 大地缸 | 来源:发表于2021-03-17 07:18 被阅读0次

title: "Npm使用国内镜像加速的几种方法"
date: 2021-02-19T21:15:22+08:00
draft: true
tags: ['npm']
author: "dadigang"
author_cn: "大地缸"
personal: "http://www.real007.cn"


关于作者

http://www.real007.cn/about

npm使用国内镜像加速的几种方法

2018-12-172018-12-17 10:29:13阅读 9.6K0

在使用npm过程中经常会遇到无法下载包的问题,本人在这里整理了几个npm使用国内镜像加速的方法,希望对大家有所帮助。

一、修改成淘宝镜像源

1. 命令

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

2. 验证命令

npm config get registry

如果返回https://registry.npm.taobao.org,说明镜像配置成功。

二、修改成华为云镜像源

1. 命令

npm config set registry https://mirrors.huaweicloud.com/repository/npm/

2. 验证命令

npm config get registry

如果返回https://mirrors.huaweicloud.com/repository/npm/,说明镜像配置成功。

三、通过使用淘宝cnpm安装

1. 安装cnpm

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

2. 使用cnpm

cnpm install xxx

相关文章

网友评论

      本文标题:Nnpm使用国内镜像加速的几种方法

      本文链接:https://www.haomeiwen.com/subject/lkawfltx.html