AWS-CodeArtifact
Table of Contents
Preface
AWS CodeArtifact is a managed artifact repository that can host npm, Maven, and other packages.
Creating a Repository
URL: https://us-west-2.console.aws.amazon.com/codesuite/codeartifact/start?region=us-west-2#
Click the “Create repository” button on the right side to begin.
After entering the name, you can select which package types to host.
Here we select Maven and npm.

In the next step, enter a domain name — typically your company or product name.

Repository created successfully.

Connecting
Before connecting to the private repository locally, you need to install the AWS CLI first: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
Follow the instructions to connect to the npm repository.

When running the command, you may see: “Unable to locate credentials. You can configure credentials by running ‘aws configure’.”
This means there are no local credentials. Run aws configure as prompted.

It will ask for an access key. Configure it following the docs: https://docs.aws.amazon.com/zh_cn/cli/v1/userguide/cli-chap-authentication.html
There are 3 ways to configure permissions. I found the 3rd method to be the simplest.

After running the command again, the npm connection succeeds.

You can also add a .npmrc file directly in your project with the following content:
registry=https://domain-accountid.d.codeartifact.us-west-2.amazonaws.com/npm/domain/
Publishing Private Packages
After configuring the .npmrc file in your project,
run npm config get registry to verify the source is indeed AWS.
Try installing a public npm package — it should work normally.

Next, publish a package.
Normally, publishing to npm requires npm login first.
AWS CodeArtifact works differently.
Click “Connection instructions” > select “npm” > choose “Manual”.
Then copy and run the first command.
Then copy the second block of content into your .npmrc file.

Run npm publish again, and the package is published successfully.

Installing Private Packages
If other users want to install private packages from AWS CodeArtifact:
First, create an IAM user for them.
Then go to IAM > Users > Security credentials > Add access key.
The user needs to install the AWS CLI locally: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
The user runs aws configure locally and enters the access key created above.
Then the user runs the following command:
aws codeartifact login --tool npm --repository domain --domain domain --domain-owner accountid --region us-west-2
Install using the AWS npm registry — either via command line, .npmrc, or npm config:
npm install @xx/util-cookie --registry=https://domain-accountid.d.codeartifact.us-west-2.amazonaws.com/npm/domain/ Related Articles
Running Multiple WeChat Clients on Mac
Preface: Many people have multiple WeChat accounts. On mobile, you can use two phones or Android multi-app features. This article explains how to run multiple WeChat clients on Mac by creating aliases to the WeChat executable inside the app bundle.
Installing MySQL on Mac
Introduction: This article covers how to install MySQL on Mac. Steps include downloading the DMG installer from the official website, installing it, and configuring the environment variables.
Grant MySQL Access to a Specific IP
AWS - Image Conversion with Lambda@Edge and CloudFront
Chinese cloud providers offer convenient image format and size conversion via URL parameters for their OSS/COS storage. AWS does not provide this out of the box — you need to write Lambda@Edge functions yourself. This article provides a complete guide on implementing image conversion with Lambda@Edge.
AWS-CertificateManager
AWS Certificate Manager is the certificate management system provided by AWS. When used together with an AWS Load Balancer, you can request wildcard certificates for free.