Skip to content
On this page

npm

自定义模块源

bash
npm install --[module-name]_binary_host_mirror=[mirror-url]

其中的 mirror-url 一般使用国内镜像地址,如 https://npm.taobao.org/mirrors,使用本地文件路径也可以,如 file://[directory-path]

一般的, mirror 下的目录结构如下

bash
mirror
  |--v[version]
     |--[module-name]-v[version]-[other-info].tar.gz