Node.js/npm/源
来自康健生活
标题文本
源地址
工具
registry
[jian@kang /home/kangkk]$
npm config get registry
http://registry.npm.qiwoo.org/
设置 registry。
/home/kangkk
# npm config set @myco:registry http://reg.example.com
npm config set registry https://registry.npm.taobao.org
进行分开测试
/home/kangkk
npm config set @q:registry http://registry.npm.qiwoo.org
npm install --registry=https://registry.npmmirror.com
nrm
npm i -g nrm
kangjian@kangkk:~/github/kangkk.github.io$
nrm ls
* npm -------- https://registry.npmjs.org/
yarn ------- https://registry.yarnpkg.com/
cnpm ------- http://r.cnpmjs.org/
taobao ----- https://registry.npm.taobao.org/
nj --------- https://registry.nodejitsu.com/
npmMirror -- https://skimdb.npmjs.com/registry/
edunpm ----- http://registry.enpmjs.org/
kangjian@kangkk:~/github/kangkk.github.io$
nrm use taobao
Registry has been set to: https://registry.npm.taobao.org/
添加额外的源,自定义源
[jian@kang /home/kangkk]$
nrm add company http://registry.npm.qiwoo.org
add registry company success
mirror-config-china
/home/kangkk
npm i -g mirror-config-china --registry=https://registry.npmmirror.com
/home/kangkk
# 查看npm配置
npm config list
# 查看环境变量
source ~/.bashrc && env
为项目生成镜像配置文件
/home/kangkk
mirror-config-china --registry=https://registry.npmmirror.com
.npmrc
.npmrc
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/
electron_mirror=https://npm.taobao.org/mirrors/electron/
registry=https://registry.npm.taobao.org
根据域设置单独源
.npmrc
registry=https://registry.nlark.com/
@q:registry=http://registry.npm.qiwoo.org
No categories