0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-04-08 02:54:13 -05:00

chore: improve info regarding using private registries (#3510)

* chore: improve info regarding using private registries

* Update Help.test.tsx.snap
This commit is contained in:
Juan Picado 2022-11-25 13:28:25 +01:00 committed by GitHub
parent 445fb0c0e5
commit 5d9b65a1e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 83 additions and 17 deletions

View file

@ -0,0 +1,5 @@
---
'@verdaccio/ui-theme': patch
---
chore: improve info regarding using private registries

View file

@ -87,7 +87,7 @@
"help": {
"title": "No Package Published Yet.",
"sub-title": "To publish your first package just:",
"first-step": "1. Login",
"first-step": "1. Create user",
"first-step-command-line": "npm adduser --registry {{registryUrl}}",
"second-step": "2. Publish",
"second-step-command-line": "npm publish --registry {{registryUrl}}",

View file

@ -44,7 +44,7 @@ const Help: React.FC = () => {
<Text variant="body2">{t('help.third-step')}</Text>
</CardContent>
<CardActions>
<Button color="primary" href="https://verdaccio.org/docs/en/installation" size="small">
<Button color="primary" href="https://verdaccio.org/docs/cli-registry" size="small">
{t('button.learn-more')}
</Button>
</CardActions>

View file

@ -304,7 +304,7 @@ exports[`<Help /> component should load the component in default state 1`] = `
<p
class="MuiTypography-root MuiTypography-body1 emotion-6"
>
1. Login
1. Create user
</p>
<div
class="emotion-7 emotion-8"
@ -386,7 +386,7 @@ exports[`<Help /> component should load the component in default state 1`] = `
>
<a
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeSmall MuiButton-textSizeSmall emotion-24"
href="https://verdaccio.org/docs/en/installation"
href="https://verdaccio.org/docs/cli-registry"
tabindex="0"
>
Learn More

View file

@ -7,7 +7,7 @@ title: "npm"
The minimum supported NPM version is 5.
## Using Verdaccio for all my projects (recommended)
## Setting up global registry for all projects {#all}
To set the registry for all your local projects in any terminal window run:
@ -16,7 +16,7 @@ npm set registry http://localhost:4873/
```
This will set the registry for your operational system user and you can find it on the file `~/.npmrc`.
## Using Verdaccio only to a specific project
## Using registry for a specific project {#specific}
To set this value for a specific project open its root folder on a terminal window and run:
```bash
@ -24,7 +24,13 @@ npm set registry http://localhost:4873/ --location project
```
This will set the registry in a `.npmrc` file in your project root directory.
## Using Verdaccio only on specific commands
or by specific scope eg: `@my-scope/auth`:
```
npm config set @my-scope:registry http://localhost:4873
```
## Using registry only on specific command {#command}
If you want one single use append `--registry http://localhost:4873/` to the required command.
Some examples:
@ -47,7 +53,37 @@ If you only want to publish your package to Verdaccio but keep installing from o
}
```
## Troubleshooting
## Creating user {#creating-user}
With npm 8 or below, either `adduser` or `login` are able to create users and login at the same time.
```bash
npm adduser --registry http://localhost:4873
```
after version `npm@9` the commands works separately:
- `login` does not create users.
```bash
npm login --registry http://localhost:4873
```
- `adduser` does not login users.
```bash
npm adduser --registry http://localhost:4873
```
Both commands relies on web login by default, but adding `--auth-type=legacy` you can get back the previous behaviour.
> [Web login is not supported for verdaccio.](https://github.com/verdaccio/verdaccio/issues/3413)
## Troubleshooting {#troubleshooting}
### `npm login` with npm@9 or higher
If you are running into issues login with `npm@9.x` or higher you could try use the legacy mode (see above).
For progress on the native support on future you can track the following [issue#3413](https://github.com/verdaccio/verdaccio/issues/3413).
### npm does not save authToken when authenticating to Verdaccio

View file

@ -106,7 +106,6 @@ Or a `publishConfig` in your `package.json`
}
}
```
For alternative configurations, please read the [Using a private registry](cli-registry.md) section.
## Create Your Own Private NPM Package Tutorial {#create-your-own-private-npm-package-tutorial}

View file

@ -7,7 +7,7 @@ title: "npm"
The minimum supported NPM version is 5.
## Using Verdaccio for all my projects (recommended)
## Setting up global registry for all projects {#all}
To set the registry for all your local projects in any terminal window run:
@ -16,7 +16,7 @@ npm set registry http://localhost:4873/
```
This will set the registry for your operational system user and you can find it on the file `~/.npmrc`.
## Using Verdaccio only to a specific project
## Using registry for a specific project {#specific}
To set this value for a specific project open its root folder on a terminal window and run:
```bash
@ -24,7 +24,13 @@ npm set registry http://localhost:4873/ --location project
```
This will set the registry in a `.npmrc` file in your project root directory.
## Using Verdaccio only on specific commands
or by specific scope eg: `@my-scope/auth`:
```
npm config set @my-scope:registry http://localhost:4873
```
## Using registry only on specific command {#command}
If you want one single use append `--registry http://localhost:4873/` to the required command.
Some examples:
@ -47,15 +53,35 @@ If you only want to publish your package to Verdaccio but keep installing from o
}
```
## Creating user {#creating-user}
With npm 8 or below, either `adduser` or `login` are able to create users and login at the same time.
```bash
npm adduser --registry http://localhost:4873
```
after version `npm@9` the commands works separately:
- `login` does not create users.
```bash
npm login --registry http://localhost:4873
```
- `adduser` does not login users.
```bash
npm adduser --registry http://localhost:4873
```
Both commands relies on web login by default, but adding `--auth-type=legacy` you can get back the previous behaviour.
> [Web login is not supported for verdaccio.](https://github.com/verdaccio/verdaccio/issues/3413)
## Troubleshooting {#troubleshooting}
### `npm login` with npm@9 or higher
If you are running into issues login with `npm@9.x` or higher you could try use the legacy mode.
```bash
npm login --auth-type=legacy
```
If you are running into issues login with `npm@9.x` or higher you could try use the legacy mode (see above).
For progress on the native support on future you can track the following [issue#3413](https://github.com/verdaccio/verdaccio/issues/3413).