- 最新
- 投票最多
- 评论最多
I was able to get Yarn 2 working with AWS CodeArtifact.
Go here to instructions how to install Yarn 2. https://yarnpkg.com/getting-started/install
First I created a script that exports a variable with the CodeArtifact token.
export CODEARTIFACT_AUTH_TOKEN=aws codeartifact get-authorization-token --domain artifact-domain --domain-owner 123456789012 --query authorizationToken --output text
I created a file in the root of the repo .yarnrc.yml with the following:
yarnPath: ".yarn/releases/yarn-berry.cjs"
nodeLinker: "node-modules"
npmRegistryServer: "https://artifact-domain-123456789012.d.codeartifact.us-east-1.amazonaws.com/npm/npm-repo/"
npmAlwaysAuth: true
npmAuthToken: ${CODEARTIFACT_AUTH_TOKEN}
So now when I do yarn install it authenticates correctly against CodeArtifact.
Thanks for posting this answer. We'll get the CodeArtifact User Guide updated with instructions for Yarn 2.
- Carl.
相关内容
- AWS 官方已更新 4 个月前
- AWS 官方已更新 2 年前
- AWS 官方已更新 5 个月前
- AWS 官方已更新 3 个月前