Sinan
Sinan

Reputation: 5980

Nexus 3 NPM proxy returns 404

I set up a proxy repository as described in the docs. At first there was a problem with scoped repositories, however after adding AllowEncodedSlashes and nocanon to apache conf. everything was working fine.

However on package in particular (@fortawesome/fontawesome-svg-core) is giving me troubles.

When I include this package it returns a 404 error. However other packages under same scope are all fine.

Note that getting the package from the regular registry works fine too.

Any ideas?

Upvotes: 3

Views: 4556

Answers (3)

Denis
Denis

Reputation: 1271

The following fixed the problem for me:

  1. Open the Nexus administration page
  2. Open the repository settings
  3. Click "Rebuild index" and "Invalidate cache" buttons
  4. Try to do it for all repositories (proxy and group)

Upvotes: 0

Christian
Christian

Reputation: 21

I was experiencing the same problem for certain @babel scoped packages. Creating a new proxy repository and replacing the old one "fixed" the issue for me. I guess the old proxy repo got corrupted somehow. Obviously you will lose all cached packages, which is is bummer.

Maybe someone else can shed some light on the causes of the issue.

Edit: A similar issue occured again at a later time for a different package.

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @angular-devkit/[email protected]
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doen't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of '@angular-devkit/build-angular'

After some investigation I noticed that the server response for https://mynexus/repository/npm-repo/@angular-devkit%2fbuild-webpack returned an outdated list of versions (or rather outdated metadata for the package). I guess the metadata is not updated correctly in some cases. I even reconfigured the repository with a metadata age of 0, but to no avail.

Deleting the asset in the repository browser worked but is far from an ideal solution.

Upvotes: 2

rseddon
rseddon

Reputation: 5320

Go to "support/logging" in the UI, and set the "org.apache.http" logger to DEBUG level. Then reproduce the issue, and examine the nexus.log. You'll be able to see the requests Nexus made to the npm registry and the responses received.

Upvotes: 4

Related Questions