# Npm ERR! 503 Service Unavailable

**URL:** <https://community.sonatype.com/t/npm-err-503-service-unavailable/7159>\
**Category:** Sonatype Nexus Repository\
**Tags:** npm\
**Created:** [August 20, 2021, 11:11am UTC](https://community.sonatype.com/t/npm-err-503-service-unavailable/7159 "2021-08-20T11:11:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anhle77](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anhle77](https://community.sonatype.com/u/anhle77)\
**Post date:** [August 20, 2021, 11:11am UTC](https://community.sonatype.com/t/npm-err-503-service-unavailable/7159/1 "2021-08-20T11:11:26Z")

</div>

Using

- nexus 3 = Sonatype Nexus Repository Manager OSS 3.33.1-01
- node = v14.17.3
- npm = 6.14.13
- Zscaler
- Windows 10

I have definied 3 npm repositories in nexus3:

- npm-group
- npm-private
- npm-registry

I have added in .npmrc :

- 3 proxies : http-proxy, https-proxy and proxy
- registry=http://localhost:9081/repository/npm-group/
- email and \_auth
- always-auth=true

I have added in packages.json :  
“publishConfig”: { “registry”: “[http://localhost:9081/repository/npm-private/](http://localhost:9081/repository/npm-private/)” }

_ **Here is my packages.json** _

```auto
{
  "name": "wampr_api",
  "version": "1.0.0",
  "description": "WORLDLINE - Report on tests API",
  "main": "index.js",
  "publishConfig" : {
    "registry" : "http://localhost:9081/repository/npm-private/"
  },
  "scripts": {
    "start": "nodemon -L index.js",
    "generate-docs": "node_modules/.bin/jsdoc -c config/jsdoc.json"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "bcrypt": "^5.0.1",
    "bluebird": "^3.7.2",
    "cors": "^2.8.5",
    "cron": "^1.8.2",
    "csv-parser": "^3.0.0",
    "dateformat": "^4.5.1",
    "dotenv": "^10.0.0",
    "express": "^4.17.1",
    "extract-zip": "^1.6.7",
    "hashmap": "^2.4.0",
    "hashset": "0.0.6",
    "html-pdf": "^3.0.1",
    "mongoose": "^5.13.3",
    "morgan": "^1.10.0",
    "move-file": "^2.1.0",
    "nodemailer": "^6.6.3",
    "nodemon": "^2.0.12",
    "ps-node-promise-es6": "0.0.1",
    "puppeteer": "^10.1.0",
    "request": "^2.88.2",
    "request-promise": "^4.2.6",
    "rotating-file-stream": "^2.1.5",
    "sharp": "^0.28.3",
    "shelljs": "^0.8.4",
    "string-contains": "^0.1.0",
    "substrings": "^1.1.1",
    "xml2js": "^0.4.23",
    "xsd-schema-validator": "^0.7.0"
  }
}

```

In order to deploy my package to the NEXUS, I do the npm command : npm publish  
But I still get the error :

**"npm ERR! code E503 npm ERR! 503 Service Unavailable - PUT [http://localhost:9081/repository/npm-private/wampr\_api](http://localhost:9081/repository/npm-private/wampr_api)"**

2 weeks ago, I could install from the nexus / deploy to the nexus. But now it is not working fine. I can not understand why this issue even if I configure proxy for nexus.

Please can you help me ?

---

<div class="post-metadata">

**Author:** ![mpiggott](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mpiggott](https://community.sonatype.com/u/mpiggott)\
**Post date:** [August 20, 2021, 1:45pm UTC](https://community.sonatype.com/t/npm-err-503-service-unavailable/7159/2 "2021-08-20T13:45:04Z")

</div>

I don’t think the 503 error code would be from Nexus, are you running a proxy server or perhaps some AV scanner perhaps that might be interferring?

---

<div class="post-metadata">

**Author:** ![anhle77](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anhle77](https://community.sonatype.com/u/anhle77)\
**Post date:** [August 20, 2021, 2:12pm UTC](https://community.sonatype.com/t/npm-err-503-service-unavailable/7159/3 "2021-08-20T14:12:04Z")

</div>

I am always running a proxy server (zscaler) and so I add the specific proxy to the zscaler in the .npmrc file.

I do not know what is the AV scanner.

---

<div class="post-metadata">

**Author:** ![mpiggott](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mpiggott](https://community.sonatype.com/u/mpiggott)\
**Post date:** [August 20, 2021, 4:40pm UTC](https://community.sonatype.com/t/npm-err-503-service-unavailable/7159/4 "2021-08-20T16:40:34Z")

</div>

Sorry AV = Anti Virus Scanner.

Basically I’m saying I do not believe the 503 is a status code from Nexus, something between npm and Nexus is returning the 503.

---

<div class="post-metadata">

**Author:** ![anhle77](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anhle77](https://community.sonatype.com/u/anhle77)\
**Post date:** [August 23, 2021, 11:09am UTC](https://community.sonatype.com/t/npm-err-503-service-unavailable/7159/5 "2021-08-23T11:09:44Z")

</div>

> [@mpiggott](#):
>
> something between npm and Nexus is returning the 503.

Hello

Thank you for your reply and your help !

I have tried to add no-proxy and it is working fine. I can deploy to the nexus

---

<div class="post-metadata">

**Author:** ![anhle77](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anhle77](https://community.sonatype.com/u/anhle77)\
**Post date:** [August 23, 2021, 1:28pm UTC](https://community.sonatype.com/t/npm-err-503-service-unavailable/7159/7 "2021-08-23T13:28:52Z")

</div>

I can publish my package to nexus but I can’t install my package from the nexus.

I have tested npm install mypackage@version with registry=http://localhost:8081/repository/npm-group/ But it is not fine 🙂

```auto
c:\WORKSPACE\PROJECTS\WAMPR\TESTAPI>npm install wampr_api@1.0.0
npm ERR! code E404
npm ERR! 404 Not Found - GET http://localhost:8081/repository/npm-group/bcrypt - Not found
npm ERR! 404
npm ERR! 404 'bcrypt@^5.0.1' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'wampr_api'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

```

" **npm ERR! 404 ‘bcrypt@^5.0.1’ is not in the npm registry.**"  
==\> when replacing with registry=https://registry.npmjs.org, it is ok  
==\> when replacing with registry=http://localhost:8081/repository/npm-group/, it is not ok

Can you help me ?

---

<div class="post-metadata">

**Author:** ![anhle77](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anhle77](https://community.sonatype.com/u/anhle77)\
**Post date:** [August 23, 2021, 2:23pm UTC](https://community.sonatype.com/t/npm-err-503-service-unavailable/7159/8 "2021-08-23T14:23:26Z")

</div>

Finally, I can install my package from Nexus because I remove https-proxy from the .npmrc…

I don’t really understand about proxy
