CodeArtifact not adding npm packages to my repository

1

I've created in CodeArtifact a domain and a main repository called "MainRepo" with two upstreams stores: npm ("npm-store") and pipy ("pipy-store"). Then locally in my PC I've created a new folder and setup the connection using AWS CLI to "MainRepo" specifying npm as tool. After checking successfully that npm is now pointing to my repository with:

npm -d ping

I proceeded to install husky and commitlint:

npm install husky --save-dev
npm install @commitlint/cli --save-dev

At this point would expected to see those packages (and their dependencies) showing up in my main repository (or at least the npm-store) but to my surprise neither of them where listed. Then I've made a number of tests, installing other packages but not a single one got added.

Finally I've tried with:

npm install -g aws-cdk

and this was indeed added to my repo and showing up in the CodeArtifact console.

Any clues on why the others packages got ignored by CodeArtifact?

질문됨 일 년 전782회 조회
1개 답변
4
수락된 답변

npm uses a local package cache. It will only reach out to the remote repository if it doesn't find the package in the cache. If you want to make sure that packages you request are stored in CodeArtifact, you can clear the cache before running npm install with npm cache clear -f. See https://docs.npmjs.com/cli/v7/commands/npm-cache for the docs.

If that wasn't the issue, you can confirm if the npm client made requests to your CodeArtifact repository using CloudTrail.

profile pictureAWS
답변함 일 년 전
profile picture
전문가
검토됨 7일 전
profile picture
전문가
검토됨 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠