Installing scoped npm packages from Artifactory

I am trying to get scoped npm packages to work with Artifactory behind Apache. I can publish a scoped package to Artifactory and it creates the following path in the npm-local repo: @scopename/packagename/-/@scopename/packagename-version.tgz

My problems arise trying to install this package. I get a 404 Not Found: @scopename/packagename. Looking at the debug log I can see that maybe it has something to do with the encoding of the slashes:

22 http request GET
23 http 404

I have followed the online documentation. I added AllowEncodedSlashes NoDecode to the virtual host and org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true to the file on tomcat.

Am I missing something?


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

This looks like a reverse proxy issue. Check your request.log. If the request is coming is as /api/npm/npm-group/@angular/core instead of /api/npm/npm-group/@angular%2Fcore, that is something that need to addressed in your reverse proxy.

You have to change two things:

  1. Implement the setting org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH = true
  2. Remove of the context root from the proxy_pass variable in /etc/nginx/conf.d/default.conf

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x