5

I'm using Node v5.0.0 and npm v3.3.6 and running into a very isolated issue with he tar package. Due to corporate firewalls I was forced to clone the Git repository and install it from that

My problem is that despite forcing npm to install packages from the cache, tar is the only package that insists on downloading it from npm's registry.

$ npm install tar@2.2.1 --verbose --cache-min=999999999999                                     
npm info it worked if it ends with ok                                                                                                        
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',                                                                                        
npm verb cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',                                                              
npm verb cli   'install',                                                                                                                    
npm verb cli   'tar@2.2.1',                                                                                                                  
npm verb cli   '--verbose',                                                                                                                  
npm verb cli   '--cache-min=999999999999' ]                                                                                                  
npm info using npm@3.3.6                                                                                                                     
npm info using node@v5.0.0                                                                                                                   
npm verb get http://registry.npmjs.org/tar not expired, no request                                                                           
npm verb cache add spec tar@2.2.1                                                                                                            
npm verb addNamed "2.2.1" is a plain semver version for tar                                                                                  
npm verb addNameVersion registry:http://registry.npmjs.org/tar not in flight; fetching                                                       
npm verb get http://registry.npmjs.org/tar not expired, no request                                                                           
npm verb addRemoteTarball http://registry.npmjs.org/tar/-/tar-2.2.1.tgz not in flight; adding                                                
npm verb addRemoteTarball [ 'http://registry.npmjs.org/tar/-/tar-2.2.1.tgz',                                                                 
npm verb addRemoteTarball   '8e4d2a256c0e2185c6b18ad694aec968b83cb1d1' ]                                                                     
npm info retry fetch attempt 1 at 8:38:23 AM                                                                                                 
npm info attempt registry request try #1 at 8:38:23 AM                                                                                       
npm http fetch GET http://registry.npmjs.org/tar/-/tar-2.2.1.tgz                                                                             
npm verb request id b8672d43f7b2c569                                                                                                         
npm http fetch 503 http://registry.npmjs.org/tar/-/tar-2.2.1.tgz                                                                             
npm info retry will retry, error on last attempt: Error: server error 503 

I've double checked my cache and can see that tar v2.2.1 is in fact present and functional.

$ npm cache list | grep 'tar\\2.2.1'
~\AppData\Roaming\npm-cache\tar\2.2.1
~\AppData\Roaming\npm-cache\tar\2.2.1\package
~\AppData\Roaming\npm-cache\tar\2.2.1\package.tgz
~\AppData\Roaming\npm-cache\tar\2.2.1\package\package.json

For what it's worth, I'm able to overcome this issue by simply adding the project's Git repository in my dependencies folder and use npm install deps/node-tar before doing npm install. Still doesn't explain the problem at hand, however.

onetwothree
  • 672
  • 1
  • 10
  • 20
  • 2
    I tried to reproduce this, but for me it works as expected, installing from the cache. I notice in your output, however, the line **npm http fetch 503 http://registry.npmjs.org/tar/-/tar-2.2.1.tgz** which suggest some issue actually downloading the tarball. I recommend trying again, and looking at [this question](http://stackoverflow.com/questions/21122814/why-is-npm-giving-500-and-503-errors-registry-error-parsing-json) which addresses the 503 issue. Also, could you post the result of `npm cache ls tar` – Philip O'Brien Nov 30 '15 at 14:59
  • Guess what I'm not understanding is why `npm` is trying to download the file at all since I'm forcing the cache using `--cache-min` and the logs show `npm verb get http://registry.npmjs.org/tar not expired, no request`. To me that means that `npm` will not be issuing a request to download the `tar` package. – onetwothree Nov 30 '15 at 15:16

0 Answers0