Search code examples
npmaws-codeartifact

How to use npm Private Package and Public Package as a proxy using AWS Codeartifact


I am developing a React-based UI component with Radix-ui, and I would like to package it so that it can be downloaded for private use within our team(with npm). When downloading this UI Component, I also would like to be able to download packages that already exist in public npm, such as react-hook-form, axios, and next, as a proxy. (This is because public npm access is not possible due to in-house network security.)

As a result, I want my team members to be able to install our UI and public packages all at once via npm install from Codeartifact.(like npx create-react-app)

I have already created a repository and an upstream repository, but I don't know how to start this. Any idea?


Solution

  • I succeeded in the following way.

    1. Packing (by tsconfig.json)
    2. Exporting (by package.json)
    3. Logging in (Codeartifact)
    4. Publishing