verdaccio: Redirect to npmjs.com when a package is not found locally

Is your feature request related to a problem? Please describe. I’m always frustrated when I click on a package dependency and all I get is this:

{
  "error": "File not found"
}

Describe the solution you’d like I would like to see a redirection to npmjs.com, whenever a package is not found locally.

Describe alternatives you’ve considered An alternative option would be to display a page with a little notice, indicating that the requested package does not exist locally, but on npmjs.com.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 17 (12 by maintainers)

Most upvoted comments

@coolsp There is an API, documented over here. It’s just the npm registry which can be used to fetch data in JSON format (example).

Steps to reproduce:

  • Setup verdaccio as scoped private repository only, in config.yaml -Remove any uplinks under uplinks -Remove any proxies under packages -Set a scope under web (e.g.: @coolsp)
  • Publish a private scoped module with a dependency to a public module (e.g. debug) -npm publish @coolsp/myprivate --registry https://<my-repo>:4873
  • Logon to the webui
  • Click on module @coolsp/myprivate
  • Click in right-pane on dependency (e.g. debug)
Error 404 - debug
Oops, The package you are trying to access does not exist.

Quod erat demonstrandum

Was thinking about same type of feature request. I’m using verdaccio only for scoped modules not to cache the official npm modules (at least for now). My scoped modules depend on some official modules but as those are not cached on verdaccio, clicking on them in the webui results in:

Error 404 - debug
Oops, The package you are trying to access does not exist.

Would be nice that in the webui you immediately include the npmjs link with a little icon next to it to indicate that it is an external link. This would mean you would have to identify those modules prior to rendering the page. Or alternatively, as suggested by @axelrindle, redirect requests for non-cached modules to npmjs.