You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. Use the `npm config set` command to set the registry to your CodeArtifact repository.
297
295
Replace the URL with the repository endpoint URL from the previous step.
298
296
299
297
```bash
300
-
npm config set registry http://demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/npm/demo-repo/
298
+
npm config set registry http://demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud:4566/npm/demo-repo/
301
299
```
302
300
303
301
4. Use the `npm config set` command to add your authorization token to your npm configuration.
304
302
305
303
```bash
306
-
npm config set //demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/:_authToken=${CODEARTIFACT_AUTH_TOKEN}
304
+
npm config set //demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud:4566/:_authToken=${CODEARTIFACT_AUTH_TOKEN}
307
305
```
308
306
309
307
:::note
310
308
**For npm 6 or lower:** To make npm always pass the auth token to CodeArtifact, even for GET requests, set the always-auth configuration variable with npm config set.
311
309
312
310
```bash
313
-
npm config set //demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud/:always-auth=true
311
+
npm config set //demo-domain-000000000000.d.codeartifact.eu-central-1.localhost.localstack.cloud:4566/:always-auth=true
314
312
```
315
313
:::
316
314
317
-
####Example npm configuration file (`.npmrc`)
315
+
### Example npm configuration file
318
316
319
317
The following is an example `.npmrc` file after following the preceding instructions to set the CodeArtifact registry endpoint, add an authentication token, and configure `always-auth`.
0 commit comments