yangbin1994/blog

yarn npm --registry

yangbin1994 opened this issue · 1 comments

  • .yarnrc 作为 .npmrcextend (扩展),.npmrc 优先级更高
  • --registry 有全局和 scope 之分,用户信息也是一样
  • @scope/$module 这样的命名不是约定而是规范,会自动找到对应 scoperegistry 地址进行 publish
  • cnpm.org 可以设置 sourceNpmRegistryIsCNpm: true 字段,来自动代理未注册的项目,去到 registry.npm.taobao.org 下载对应包。
cat ~/.npmrc

prefix=/Users/yangbin/global/node_modules
registry=https://registry.npmjs.org/
@tarsocial:registry=http://registry.npm.tarsocial.com/
//registry.npm.tarsocial.com/:_password=xxx
//registry.npm.tarsocial.com/:username=bin.yang
//registry.npm.tarsocial.com/:email=bin.yang@tarsocial.com
//registry.npm.tarsocial.com/:always-auth=true
//registry.npmjs.org/:_authToken=xxx