我有一个本地 Nexus 服务器,基本上我希望在上线之前先查看一下它prefer-offline
yarn install \
--prefer-offline \
--cache-folder C:\folder\yarn-cache \
--preferred-cache-folder C:\folder\yarn-cache \
--non-interactive \
--no-lockfile \
--registry http://server/repository/npm-group
Yarn 无法离线找到依赖项,然后无法上线。我不知道这是否可以解决。
- 创建一个npm(托管)用作您的私人注册表的存储库。
我相信你已经做到了这一点。
- 创建一个npm(代理)存储库指向您选择的外部存储库
(https://registry.yarnpkg.com https://registry.yarnpkg.com or https://registry.npmjs.org/ https://registry.npmjs.org/).
- 创建一个尼普 (群展)您的私人注册表位于第一个位置,代理注册表位于第二个位置。
- Point yarn到您的组存储库:
yarn config set registry http://nexus.local/repository/npm-group/
。如果您的 Nexus 配置需要,请验证纱线:yarn login
.
也要警惕yarn使用任何npm您可能拥有自己的配置:https://github.com/yarnpkg/yarn/issues/4862 https://github.com/yarnpkg/yarn/issues/4862
Yarn v2+ 更新:
Yarn v2+ 使用不同的配置密钥来更新 NPM 注册表,称为 npmRegistryServer(请参阅他们的移民 https://yarnpkg.com/getting-started/migration#update-your-configuration-to-the-new-settings详情页):
yarn config set npmRegistryServer http://nexus.local/repository/npm-group/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)