# NPM REST API command using account and password

**URL:** https://community.sonatype.com/t/npm-rest-api-command-using-account-and-password/14913
**Category:** Sonatype Nexus Repository
**Tags:** npm-rest-api
**Created:** [May 9, 2025, 4:34am UTC](https://community.sonatype.com/t/npm-rest-api-command-using-account-and-password/14913 "2025-05-09T04:34:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![chang\_park](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@chang\_park](https://community.sonatype.com/u/chang_park)
#### Post date: [May 9, 2025, 4:34am UTC](https://community.sonatype.com/t/npm-rest-api-command-using-account-and-password/14913/1 "2025-05-09T04:34:23Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mgarzon](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@mgarzon](https://community.sonatype.com/u/mgarzon)
#### Post date: [May 12, 2025, 8:00pm UTC](https://community.sonatype.com/t/npm-rest-api-command-using-account-and-password/14913/2 "2025-05-12T20:00:29Z")

</div>

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:

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

Or with curl:

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).
