# "npm error 405 Method Not Allowed - PUT" with npm-publish

**URL:** <https://community.sonatype.com/t/npm-error-405-method-not-allowed-put-with-npm-publish/14035>\
**Category:** Sonatype Nexus Repository\
**Tags:** nexus-repository, npm\
**Created:** [December 12, 2024, 4:46pm UTC](https://community.sonatype.com/t/npm-error-405-method-not-allowed-put-with-npm-publish/14035 "2024-12-12T16:46:59Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![amu](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@amu](https://community.sonatype.com/u/amu)\
**Post date:** [December 12, 2024, 4:46pm UTC](https://community.sonatype.com/t/npm-error-405-method-not-allowed-put-with-npm-publish/14035/1 "2024-12-12T16:46:59Z")

</div>

Hi there,

I have been struggling with NPM package publication for a while now and can’t find the solution…

We have a Nexus repos installed in our infra (Sonatype Nexus RepositoryOSS 3.74.0-05) inside which I created an NPM hosted repository. Whenever I try to publish an artifact (using npm-publish) I receive an error 405 with the only additional information that the PUT command is not allowed…

```auto
npm notice Publishing to https://nexus.<company_name>.io//repository/<repo_name>/ with tag latest and default access
npm error code E405
npm error 405 Method Not Allowed - PUT https://nexus.<company_name>.io//repository/<repo_name>/@<company_name>%2<package_name>

```

Authentication does not seem to be the problem here since I instead receive a 401 error if I voluntarily corrupt the token (login:password | openssl base64).

Here is the list of commands I used:

```auto
npm config set registry=https://nexus.<company_name>.io/repository/<repo_name>/
npm config set @switstack:registry=https://nexus.<company_name>.io//repository/<repo_name>/
npm config set email=admin@<company_name>.io
npm config set //nexus.<company_name>.io/repository/<repo_name/:_auth=<token>
npm publish

```

I’m a little bit hopeless. Any help would be much appreciated…

Thanks!

---

_[View the full topic](https://community.sonatype.com/t/npm-error-405-method-not-allowed-put-with-npm-publish/14035)._
