NPM installs failing when using Virtual Repo configuration
This post was updated on .
Hello I am having an issue with an NPM virtual repo configuration that I was hoping someone might be able to help with.
I am using Artifactory 4.3.3 behind a corporate proxy and I am an Artifactory admin. Artifactory has been used to host several different kinds of artifacts successfully, but I am having an issue with NPM. I configured the proxy access and validated that the connection is working. I then created a virtual npm repo which is backed by a local npm repo and a remote (proxy) npm repo. In the remote repo, I am connecting to https://registry.npmjs.org and I am able to validate the connection.
From a linux shell, I was able to call the auth API and get back the auth information to place inside of my local .npmrc. Then, I tried an npm install of rimraf (and a few other small packages). I can see that npm is talking to the virtual repo and the package.json is being imported into the remote repo and local cache but the install fails and generates an npm-debug file. The debug file shows that fetches of tar files from the npm registry are failing.
Here is an excerpt from the npm-debug log, with server and port modified:
61 verbose addRemoteTarball http://<server>:<port>/api/npm/myvirtual-repo/rimraf/-/rimraf-2.5.4.tgz not in flight; adding
62 verbose addRemoteTarball [ 'http://<server>:<port>/api/npm/myvirtual-repo/rimraf/-/rimraf-2.5.4.tgz',
62 verbose addRemoteTarball '96800093cbf1a0c86bd95b4625467535c29dfa04' ]
63 info retry fetch attempt 1 at 12:39:52 PM
64 info attempt registry request try #1 at 12:39:52 PM
65 http fetch GET http://<server>:<port>/api/npm/myvirtual-repo/rimraf/-/rimraf-2.5.4.tgz
66 http fetch 404 http://<server>:<port>/api/npm/myvirtual-repo/rimraf/-/rimraf-2.5.4.tgz
67 error fetch failed http://<server>:<port>/api/npm/myvirtual-repo/rimraf/-/rimraf-2.5.4.tgz
68 warn retry will retry, error on last attempt: Error: fetch failed with status code