【问题标题】:Appcenter build 401 while fetching private repo packageAppcenter 在获取私有 repo 包时构建 401
【发布时间】:2021-10-04 21:18:32
【问题描述】:

我们使用 appcenter.ms 来构建和部署我们的移动应用程序。

当我不得不使用我的帐户将 appcenter.ms 重新连接到 github 时,这个错误开始了,以前的帐户由离开公司的员工持有。

当构建过程运行 yarn install 时,它会在公司的私有 repo 上显示 401。

yarn install v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
warning Pattern ["@apollo/client@latest"] is trying to unpack in the same destination "/Users/runner/Library/Caches/Yarn/v6/npm-@apollo-client-3.4.7-63d7c3539cxxxxxxxxx9a8d1ad-integrity/node_modules/@apollo/client" as pattern ["@apollo/client@^3.3.18","@apollo/client@^3.0.0-beta.23","@apollo/client@^3.2.4","@apollo/client@^3.0.0-beta.24"]. This could result in non-deterministic behavior, skipping.
error An unexpected error occurred: "https://npm.pkg.github.com/download/xxxcompanyxxx/xxxprivaterepoxxx/0.0.10/6ebbf8b6583aaa977e798812d843a9989cd5498c1cf7e3dcedfb37cdd95e9ae6: Request failed \"401 Unauthorized\"".
info If you think this is a bug, please open a bug report with the information provided in "/Users/runner/work/1/s/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

当我重新连接到我的 github 时,我必须重新构建配置(在其中设置 xcode 版本、.p12 证书、env 变量等)。我在那里没有看到任何特定于 github 访问或私有存储库的配置选项。

是否有我缺少的配置步骤,无论是在 appcenter 端还是在 github 上?

【问题讨论】:

    标签: github visual-studio-app-center visual-studio-app-center-distribute


    【解决方案1】:

    我发现了问题。 Appcenter 使用.npmrc 通过 Github 个人访问令牌进行身份验证。见这篇文章:

    https://blog.theodo.com/2018/07/installing-private-npm-packages-appcenter-2/

    https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-with-a-personal-access-token

    对我来说,这个令牌已经过期,所以我更换了它并解决了我的问题。如果您遇到类似问题,请确认您的 .npmrc 具有良好的令牌。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-23
      • 1970-01-01
      • 1970-01-01
      • 2023-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-01
      相关资源
      最近更新 更多