Skip to content

Commit 5c80e5e

Browse files
committed
chore: update documentation
1 parent ad3758a commit 5c80e5e

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,38 +83,47 @@ Then you can import these fonts ether in your `main.ts` file or `global.css` fil
8383
## Troubleshooting
8484

8585
### Unauthorized error
86+
8687
#### Context
88+
8789
You added this library as a dependency to your repository's package.json.
8890

8991
#### Possible Errors
92+
9093
- `error An unexpected error occurred: "https://npm.pkg.github.com/@hivemq%2fui-theme: unauthenticated: User cannot be authenticated with the token provided.".`
9194
- `error An unexpected error occurred: "https://npm.pkg.github.com/download/@hivemq/ui-theme/0.2.0/ca9f1eaf504872aad12d56766542624d511169fa: Request failed \"401 Unauthorized\"".`
9295

9396
#### Resolution - try 1
97+
9498
1. Read the [Generate a new personal token for your GitHub user](https://docs.github.com/en/[email protected]/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token) guide
95-
- Click on [Developer Settings](https://github.com/settings/apps) on GitHub, then on `Personal access tokens`.
96-
- Choose `Generate new token (classic)`.
97-
- In the scope, select at least `read:packages`.
98-
- Remember to copy the generated token before it disappears.
99+
* Click on [Developer Settings](https://github.com/settings/apps) on GitHub, then on `Personal access tokens`.
100+
* Choose `Generate new token (classic)`.
101+
* In the scope, select at least `read:packages`.
102+
* Remember to copy the generated token before it disappears.
99103
2. Save your new token to an environment variable (e.g. in `~/.bashrc` or `~/.zshrc`):
104+
100105
```bash
101106
export NPM_TOKEN=${YOUR_TOKEN}
102107
//npm.pkg.github.com/:_authToken=${YOUR_TOKEN}
103108
```
109+
104110
where `${YOUR_TOKEN}` is the token you obtained from Github remember to refresh your terminal after adding the it. (e.g. `source ~/.bashrc` depending on your shell)
105111
Note that with the second line, you should not need to run `npm login`.
106112

107-
3. Re-run your repository's installation step (e.g. `yarn install`).
113+
1. Re-run your repository's installation step (e.g. `yarn install`).
108114

109115
#### Resolution - try 2
116+
110117
If the problem persists, you might need to log in to github.
111118

112119
From your `ui-theme` repo or the one you're importing `ui-theme` from, try to log in with github. Use your github username, and provide the new or updated token as the password:
120+
113121
```shell
114122
npm login --scope=@hivemq --auth-type=legacy --registry=https://npm.pkg.github.com
115123
```
116124

117125
![github login](docs/github-login.png)
118126

119127
#### If the problem still persists
128+
120129
Check that your user has permissions to access https://github.com/hivemq. You might need to contact an admin to help you out.

0 commit comments

Comments
 (0)