Files
cheatsheet-tldr/tldr/npm-login
2025-08-03 00:24:25 +00:00

23 lines
510 B
Plaintext

---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# npm login
> Log in to a registry user account.
> See also: `npm logout` for logging out.
> More information: <https://docs.npmjs.com/cli/npm-login>.
- Log in to a registry user account and save the credentials to the `.npmrc` file:
`npm login`
- Log in using a custom registry:
`npm login --registry {{registry_url}}`
- Log in using a specific authentication strategy:
`npm login --auth-type {{legacy|web}}`