Dan*_*ams 14 npm gem-fury yarnpkg
我正在使用Gem Fury作为我们的一些私人套餐.我将yarn注册表设置为使用它们的代理用于public和我们的私有节点模块:
yarn config set registry "https://npm-proxy.fury.io/$GEMFURY_TOKEN/username"
Run Code Online (Sandbox Code Playgroud)
GEMFURY_TOKEN是的.bash.yarn config get registry生产:
https://npm-proxy.fury.io/$(GEMFURY_TOKEN)/username
Run Code Online (Sandbox Code Playgroud)
当我们运行时yarn,该yarn.lock文件将生成以下内容:
private-module@0.1.0:
version "0.1.0"
resolved "https://npm.fury.io/username/private-module/-/0.1.0.tgz?auth=<GEMFURY TOKEN>"
dependencies:
ember-cli-babel "^5.1.6"
private-module-2@0.1.4:
version "0.1.4"
resolved "https://npm.fury.io/username/private-module-2/-/0.1.4.tgz?auth=<GEMFURY TOKEN>"
dependencies:
ember-cli-babel "^5.1.6"
ember-inflector "^1.9.6"
Run Code Online (Sandbox Code Playgroud)
我不想在git存储库中使用私有令牌.有没有办法可以排除令牌yarn.lock在生成时被添加到文件中?
尝试按照Gem Fury 文档npm中的描述进行设置。关键部分是设置和使用always-authtruenpm login
如果这没有帮助,那么您可以使用Git 预提交挂钩yarn.lock,该挂钩将在将更改提交到存储库时删除凭据Git。