- 최신
- 최다 투표
- 가장 많은 댓글
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 공식업데이트됨 8달 전