Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NPM always uses AWS Codeartifact

I have some different projects in my local machine. Some of then uses AWS Codeartifact to download private dependencies in AWS Codeartifact, and others do not use. The projects that uses AWS Codeartifact manage their dependencies with Yarn, and my projects that do not uses AWS Codeartifact manage their dependencies with NPM.

When i run a simple command in NPM like:

npm install nanoid

The npm tries to connect to my AWS Codeartifact and it gives an error:

Unable to authenticate, need: Bearer realm="domain-npm-repo/npm-repo", Basic realm="domain-npm-repo/npm-repo"

How can i configure my machine to use AWS Codearticaft only to the projects i want?

Other Configurations:

My machine is a Windows 10, and i have aws-sdk installed globally with my credentials.

like image 603
Matheus Carvalho Avatar asked Apr 14 '26 10:04

Matheus Carvalho


1 Answers

I solved it running the command:

npm config set registry https://registry.npmjs.org/

It set my npm registry back to the default value and uses the npm registry instead of my aws codeartifact registry.

like image 170
Matheus Carvalho Avatar answered Apr 16 '26 04:04

Matheus Carvalho