找回密码
 立即注册
查看: 157|回复: 3

换npm仓库地址为淘宝镜像地址(推荐)

[复制链接]

8

主题

5

回帖

149

积分

注册会员

积分
149
发表于 2022-9-19 21:58:09 | 显示全部楼层 |阅读模式
终端输入:
命令:
  1. npm config set registry https://registry.npm.taobao.org
复制代码


查看是否更改成功:
  1. npm config get registry
复制代码


以后安装时,依然用npm命令,但是实际是从淘宝国内服务器下载的

  1. npm install -g cnpm --registry=https://registry.npm.taobao.org
复制代码





回复

使用道具 举报

3

主题

7

回帖

243

积分

中级会员

积分
243
发表于 2022-9-21 13:57:46 | 显示全部楼层
回复

使用道具 举报

9

主题

37

回帖

151

积分

注册会员

积分
151
发表于 2022-9-27 18:01:51 来自手机 | 显示全部楼层
一、修改成腾讯云镜像源  1、命令  npm config set registry http://mirrors.cloud.tencent.com/npm/  2. 验证命令  npm config get registry  如果返回http://mirrors.cloud.tencent.com/npm/,说明镜像配置成功。  二、修改成淘宝镜像源  1. 命令  npm config set registry https://registry.npmmirror.com  2. 验证命令  npm config get registry  如果返回https://registry.npmmirror.com,说明镜像配置成功。  三、修改成华为云镜像源  1. 命令  npm config set registry https://mirrors.huaweicloud.com/repository/npm/  2. 验证命令  npm config get registry  如果返回https://mirrors.huaweicloud.com/repository/npm/,说明镜像配置成功。
回复

使用道具 举报

9

主题

37

回帖

151

积分

注册会员

积分
151
发表于 2022-9-27 18:02:37 来自手机 | 显示全部楼层
楼主的镜像源有点老旧了,新的参考我发的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|粤嵌技术交流空间

GMT+8, 2025-7-7 12:56 , Processed in 0.696309 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表