Chetan Sharma
Chetan Sharma

Reputation: 193

Jfrog Artifactory does not work with NPM packages from @types (NPM organization/scope)

We use artifactory for npm, bower etc for our projects. now we want to use new feature TypeScript type definitions to fetch the npm package as @types/jasmine (NPM organization/scope) through artifactory but when we try to access it we get http 400

$ npm install -g protractor    
npm http 400 http://artifactory/artifactory/api/npm/npm-virtual/@types%2fjasmine

we are able to access the link directly on npm public repo but. it doesn't work through artifactory. is it still not supported . is there a workaround or fix.

Upvotes: 1

Views: 2192

Answers (1)

Joe Clay
Joe Clay

Reputation: 35847

From the Artifactory user guide:

Npm 'slash' character encoding

By default, the npm client encodes slash characters ('/') to their ASCII representation ("%2f") before communicating with the npm registry. If you are running Tomcat as your HTTP container (the default for Artifactory), this generates an "HTTP 400" error since Tomcat does not allow encoded slashes by default. To avoid this error when using npm scope packages, you can override this default behavior by defining the following property in the catalina.properties file of your Tomcat:

org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true

Upvotes: 7

Related Questions