Skip to main content

Using npm

tip

We highly recommend using yarn 2+ as your package manager. Besides the benefit of yarn over npm of better deterministic builds across different systems, It supports moving dependencies inside the project folder.

Once you acquire the packages either using the token or by visiting the AWS code repository, you further would be able to keep the packages in the repository itself and install them without any external connection required.

If you are using Node >= 16.10, then you already have yarn available.

Follow these simple steps to use yarn or to migrate an existing project to yarn.

Read the official AWS Guide.

1. Getting access token

export CODEARTIFACT_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain neev --domain-owner 529730085565 --query authorizationToken --output text --region eu-west-2`

More details on getting the authorization token.

tip

If you get "An error occurred (ResourceNotFoundException) when calling the GetAuthorizationToken operation: Domain not found. Domain 'neev' owned by account '529730085565' does not exist."
Then make sure the aws cli has been set with an account in the o-akodnm2nsf org id. (ECS org).

caution

The token is valid for 12 hours by default. You'll need to call this command again to get a new token.

2. Installing packages

Try installing a package

npm install @neev/logger
caution

We know that accessing these packages from a client environment may not always be possible.

That is why we recommend using yarn 2+ as your package manager to move all dependencies inside your project folder.

If still using npm we would recommend committing your node_modules folder to your repository.

info

We are working on some other ways to support offline installations.