如何自动升级私有包的Yarn?

huangapple go评论77阅读模式
英文:

How to automate upgrade yarn for private packages?

问题

我正在尝试自动化处理私有 npm 包,该包已发布在 GitHub 上。我尝试创建 .yarnrc.yml 文件,内容如下所示:

npmScopes:
  yarn-package-publisher:
    npmPublishRegistry: 'https://npm.pkg.github.com/'
    npmAlwaysAuth: true
    npmAuthToken: my_token

然后运行了 yarn config set .yarnrc.yml 并尝试通过 yarn upgrade 进行升级。另一种解决方案是创建 .yarnrc 文件,内容如下:

//npm.pkg.github.com/:_authToken=my_token
@neetesshhr:registry=https://npm.pkg.github.com/
always-auth=true

运行上述命令,但遇到了权限问题。<br/>
注意 我正在尝试通过 Jenkins 自动化升级我的包。

英文:

I am trying to automate yarn package which is private npm package published on github. I tried making .yarnrc.yml file which looks like this

npmScopes:
  yarn-package-publisher:
    npmPublishRegistry: &#39;https://npm.pkg.github.com/&#39;
    npmAlwaysAuth: true
    npmAuthToken: my_token

and i ran yarn config set .yarnrc.yml and tried to upgrade through yarn upgrade the other solution I tried is making .yarnrc which looks like this

//npm.pkg.github.com/:_authToken=my_token
@neetesshhr:registry=https://npm.pkg.github.com/
always-auth=true

and ran the above command but got permission issue. <br/>
Note I am trying to automate to upgrade my packages through jenkins

答案1

得分: 0

以下是翻译好的部分:

"Here's the solution I got my node version was 18x so I have to use node 14.x and use .npmrc file and set the yarn config to install my creds to node modules and I deployed it now working as I expected to be."
"这是我得到的解决方案,我的 Node 版本是 18x,所以我必须使用 Node 14.x,并使用 .npmrc 文件,并设置 Yarn 配置以将我的凭据安装到 Node 模块中,我已经部署了它,现在它按照我预期的方式工作。"
"yarn config set .npmrc"

英文:

Here's the solution I got my node version was 18x so I have to use node 14.x and use .npmrc file and set the yarn config to install my creds to node modules and I deployed it now working as I expected to be.
yarn config set .npmrc

huangapple
  • 本文由 发表于 2023年6月27日 20:35:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76564937.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定