Skip to content

Commit

Permalink
fix: refine docs (#24)
Browse files Browse the repository at this point in the history
<!-- 👋 Hi, thanks for sending a PR to azdo-npm-auth! 💖.
Please fill out all fields below and make sure each item is true and [x]
checked.
Otherwise we may not be able to review your PR. -->

## PR Checklist

- [ ] Addresses an existing open issue: fixes #000
- [ ] That issue was marked as [`status: accepting
prs`](https://github.com/johnnyreilly/azdo-npm-auth/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- [ ] Steps in
[CONTRIBUTING.md](https://github.com/johnnyreilly/azdo-npm-auth/blob/main/.github/CONTRIBUTING.md)
were taken

## Overview

<!-- Description of what is changed and how the code change does that.
-->
  • Loading branch information
johnnyreilly authored Dec 8, 2024
1 parent 4f6208a commit 5b93351
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ It is possible to use environment variables to control the `registry` setting as
npm_config_registry=https://registry.npmjs.org npx azdo-npm-auth
```

But the `--registry` flag is the recommended approach.
But passing the `--registry` flag directly is the recommended approach.

### `registry` mode

Expand Down Expand Up @@ -109,7 +109,7 @@ It is still possible to integrate `azdo-npm-auth` in a `preinstall` script in yo
},
```

However, as you're probably noticing, this approach requires having multiple `package.json`s and only having the `.npmrc` file in the nested one. Assuming that works for you, brilliant. It may not - don't worry. We'll talk about that in a second.
However, as you're probably noticing, this approach requires having multiple `package.json`s and only having the `.npmrc` file in the nested one. Assuming that works for you, brilliant. It may not.

The `--yes` flag above skips having npm challenge the user as to whether to download the package; useful in a CI environment.

Expand Down Expand Up @@ -171,6 +171,8 @@ npm error To correct this please try logging in again with:
npm error npm login
```

You need to run `npx -y --registry https://registry.npmjs.org azdo-npm-auth` to create the user `.npmrc` file.

### Token used in user `.npmrc` file is expired

When your token has expired in your user `.npmrc` file you'll encounter an error like this:
Expand All @@ -189,6 +191,8 @@ npm error probably out of date. To correct this please try logging in again with
npm error npm login
```

You need to run `npx -y --registry https://registry.npmjs.org azdo-npm-auth` to get a new PAT and recreate the user `.npmrc` file.

## Credits

> 💙 This package was templated with [`create-typescript-app`](https://github.com/JoshuaKGoldberg/create-typescript-app).

0 comments on commit 5b93351

Please sign in to comment.