mardi 24 février 2015

NPM Install not working with artifactory behind proxy

I have configured artifactory and npm to work behind a proxy:


npm config set registry http://myserver:8081/artifactory/api/npm/npmjs


When I call npm info bower it works fine but the tarball URL already looks suspicous: { tarball: 'http://myserver:8081/artifactory/api/npm/npmjs/registry.npmjs.org/bower/-/bower-1.3.12.tgz', shasum: '37de0edb3904baf90aee13384a1a379a05ee214c' }


npm install bower fails because of the wrong tarball URL. This is the relavant output of my npm-debug.log:



34 silly mapToRegistry registry http://myserver:8081/artifactory/api/npm/npmjs
35 silly mapToRegistry uri http://myserver:8081/artifactory/api/npm/npmjs/bower
36 verbose addRemoteTarball http://myserver:8081/artifactory/api/npm/npmjs/registry.npmjs.org/bower/-/bower-1.3.12.tgz not in flight; adding
37 verbose addRemoteTarball [ 'http://myserver:8081/artifactory/api/npm/npmjs/registry.npmjs.org/bower/-/bower-1.3.12.tgz',
37 verbose addRemoteTarball '37de0edb3904baf90aee13384a1a379a05ee214c' ]
38 info retry fetch attempt 1 at 11:39:11
39 info attempt registry request try #1 at 11:39:11
40 http fetch GET http://myserver:8081/artifactory/api/npm/npmjs/registry.npmjs.org/bower/-/bower-1.3.12.tgz
41 http fetch 404 http://myserver:8081/artifactory/api/npm/npmjs/registry.npmjs.org/bower/-/bower-1.3.12.tgz
42 error fetch failed http://myserver:8081/artifactory/api/npm/npmjs/registry.npmjs.org/bower/-/bower-1.3.12.tgz


The part registry.npmjs.org in the URL is wrong and the correct tarball URL should be this one: http://myserver:8081/artifactory/api/npm/npmjs/bower/-/bower-1.3.12.tgz. From this URL I can downlaod the tarball manually using curl.


Any ideas if I have configured something wrong or if there is a bug somewhere?


Artifactory v3.4.2, npm v2.5.1


Aucun commentaire:

Enregistrer un commentaire