npm use of domestic mirror source

[Heel]

A, by arranging npm

  • By setting config

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

# 验证指令
npm config get registry
  • Command line specifies
npm --registry https://registry.npm.taobao.org
  • Edit the configuration file ~ / .npmrc added the following content
registry = https://registry.npm.taobao.org

Second, by using cnpm


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

# 使用 cnpm 
cnpm install xxx

Third, relevant information

Taobao NPM Mirror: https://npm.taobao.org/
create or use a mirror, reference:https://github.com/cnpm/cnpmjs.org

Guess you like

Origin blog.51cto.com/tchuairen/2427979