简体   繁体   English

纱线注册表和 npm 注册表之间的区别

[英]difference between yarn registry and npm registry

Yarn install generates a yarn.lock file which fetches packages from npmjs . Yarn install 生成一个 yarn.lock 文件,该文件从npmjs获取包。

  1. How is npmjs different from yarnpkg ? npmjsyarnpkg有何不同?
  2. How do I configure yarn to fetch from yarnpkg ?如何配置 yarn 以从yarnpkg获取?
  3. Between npmjs and yarnpkg which one is preferred?npmjsyarnpkg之间,首选哪一个?

As far as the registries go, there is essentially no difference.就注册表 go 而言,基本上没有区别。 According to one of the Yarn devs , they just maintain a server that redirects to NPM's registry so that they can monitor traffic and attempt to speed things up.一位 Yarn 开发人员说,他们只是维护了一个重定向到 NPM 注册表的服务器,以便他们可以监控流量并尝试加快速度。 And if you want to change a registry, you can do so on a per-project basis by editing the "registry" key in your .npmrc or globally with npm config set registry to use whatever endpoint you want to download from.如果您想更改注册表,您可以通过编辑.npmrc中的“注册表”键或使用npm config set registry全局编辑"registry"键,以使用您要从中下载的任何端点,以每个项目为基础进行更改。 For yarn you can use yarn config set registry <registry-url> with an optional global flag .对于 yarn,您可以使用带有可选全局标志yarn config set registry <registry-url>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM