# Can't publish npm package to nexus 2

**URL:** <https://community.sonatype.com/t/cant-publish-npm-package-to-nexus-2/9911>\
**Category:** Sonatype Nexus Repository\
**Created:** [January 12, 2023, 3:20pm UTC](https://community.sonatype.com/t/cant-publish-npm-package-to-nexus-2/9911 "2023-01-12T15:20:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fatimaamzil93](https://avatars.discourse-cdn.com/v4/letter/f/58956e/32.png) [@fatimaamzil93](https://community.sonatype.com/u/fatimaamzil93)\
**Post date:** [January 12, 2023, 3:20pm UTC](https://community.sonatype.com/t/cant-publish-npm-package-to-nexus-2/9911/1 "2023-01-12T15:20:35Z")

</div>

Hi everyone,  
I’m facing this error: "Unable to authenticate, need: BASIC realm=“Sonatype Nexus Repository Manager”.

Nexus version: 2.15.0  
npm: 8.19.2  
My user has all necessary rights I need to publish my package on the Nexus server.  
I googled and read almost all posts about this error on StackOverFlow and they usually say I need to enable the Bearer Token on Nexus, but I don’t have this option on Nexus 2. It exist only on Nexus 3.  
I’ve set the .npmrc with the right conf, user, registry, always-auth and \_auth.  
Have you faced this issue? Any ideas? Thank you so much for your help in advance.  
Kind regards,  
Fatima
