npm强制时不从缓存中安装tar包

时间:2015-11-20 13:50:53

标签: node.js caching npm

我正在使用Node v5.0.0和npm v3.3.6,并且遇到了tar包的一个非常孤立的问题。由于企业防火墙,我被迫克隆Git存储库并从那个

安装它

我的问题是,尽管迫使npm从缓存中安装软件包,tar唯一的软件包,它坚持从npm的注册表下载它。

$ 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 

我已经仔细检查了我的缓存,并且可以看到tar v2.2.1实际上存在且功能正常。

$ 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

对于它的价值,我能够通过在我的依赖项文件夹中添加项目的Git存储库并在执行npm install deps/node-tar之前使用npm install来克服这个问题。但是,仍然没有解释手头的问题。

0 个答案:

没有答案