# NPM REST API command using account and password

## post by chang_park on May 9, 2025

Hello,

Nexus OSS doesn’t seem to support user token. Can you please help what is the command with user account and password to download/upload NPM package in Curl or REST API?

Thanks,

Chang

## post by mgarzon on May 12, 2025

Hi Chang Park

You are correct, Sonatype Nexus Repository OSS does not support user tokens; this feature is only available in Nexus Repository Pro. For Nexus OSS, you must use your regular user account and password for authentication.

To download an NPM package using curl, you can use the following command, replacing `username`, `password`, and the URL with your actual values:

```bash
wget --user username --password password https://:8081/repository/npm-proxy/your-package/-/your-package-version.tgz
```

Or with curl:

```bash
curl -u username:password -O https://:8081/repository/npm-proxy/your-package/-/your-package-version.tgz
```

This approach uses basic authentication with your Nexus user credentials, which is supported in Nexus OSS for accessing repositories [Download artifacts using URI](https://help.sonatype.com/en/download-artifacts-using-uri.html).

For uploading (publishing) NPM packages, you typically use the npm CLI, but if you need to authenticate, you can configure your `.npmrc` file with your username and password (base64-encoded).
