npm切换源
最编程
2024-03-14 10:28:07
...
国内npm镜像
淘宝npm镜像
搜索地址:http://npm.taobao.org/
registry地址:http://registry.npm.taobao.org/
cnpmjs镜像
搜索地址:http://cnpmjs.org/
registry地址:http://r.cnpmjs.org/
使用
有很多方法来配置npm的registry地址,下面根据不同情境列出几种比较常用的方法。以淘宝npm镜像举例:
临时使用
npm --registry https://registry.npm.taobao.org install express
持久使用
npm config set registry https://registry.npm.taobao.org
// 配置后可通过下面方式来验证是否成功
npm config get registry
// 或
npm info express
通过cnpm使用
npm install -g cnpm --registry=https://registry.npm.taobao.org
// 使用
cnpm install express
推荐阅读
-
Flutter Practice】应用程序内的国际化和语言切换功能 - 在应用程序内切换语言
-
人工智能:2020北京智源大会五位图灵奖得主与百余位专家 "共话人工智能下一个十年"--6月21日~6月24日日程安排(实时更新,推荐收藏)--6月21日晚
-
centos7 进入系统图形已盘旋或命令行提示开始切换根处理方法
-
MTK】运行时间可切换配置机制
-
mac os 快速切换多个 PHP 版本的方法 - 方法三
-
切换如何更新氛围,并进入 hekate 界面
-
HTML/CSS 开关切换(包括选中选项的 JS 控制)
-
使用 HomeAssistant 远程切换电脑
-
*切换自启动设置
-
Arch Linux 切换 rEFInd 引导加载程序