Herald Tech Notes
built
  • Home
  • Favorite
  • About
  • Search
Subscribe
Tagged

NPM

A collection of 1 post

NPM

NPM 使用国内镜像

NPM 安装包的速度出奇的慢,因为会直接访问官方海外仓库。伟大的淘宝对官方包仓库做了镜像,每10分钟同步一次,可以说非常及时了。 淘宝NPM镜像 建议使用他们封装的 cnpm 工具,但我个人不喜欢。理想的方式是保持 npm 命令,从国内镜像下载包。 实现方法很简单,只要一条命令。 $ npm set registry https://registry.npm.taobao.org npm 会把这条记录写入到 ~/.npmrc 配置文件,配置成果如下。 $ npm config list ; cli configs metrics-registry = "https://registry.npm.taobao.org/" scope = "" user-agent = "npm/6.

  • Herald Yu
Herald Yu Mar 28, 2019 • 1 min read
Herald Tech Notes © 2022
Powered by Ghost