rxaviers / cldr-data-npm

Npm module for Unicode CLDR JSON data
MIT License
42 stars 28 forks source link

npm install issue #32

Open dbendy opened 8 years ago

dbendy commented 8 years ago

I apologize if this is not the right place for this. My company is currently using cldr-data with Globalize. We notice that whenever someone does an npm install, the data is downloaded again, even if it was previously downloaded. I assume that the default npm install behavior was overridden to make this happen. I am sure that this was done for a good reason but I am wondering what that reason was purely for my own understanding. Also, is there anything that can be done in order to change this behavior or simply to improve the developer experience? People are unhappy with the fact that the npm install time just increased by about 2 minutes. Thanks!

rxaviers commented 8 years ago

Hi @dbendy, thanks for bringing this up to my attention. I understand CLDR data is considerably large and re-downloading it is a tedious behavior, I agree this should be fixed.

One suggestion I have to address that is #28. Would you like to work on that? Thanks

dbendy commented 8 years ago

@rxaviers: that solution will help if I have multiple apps on the same machine that all use CLDR data. I'm asking about the situation where I have just one app. If I do an npm install within one app to pull down the cldr-data and then, without deleting the data, do an npm install again, all the data installs again. Why does this have to be? Normal npm behavior is to only pull down missing modules. Why can't it look to see if there is an existing copy of the data first before installing all the data again?

rxaviers commented 8 years ago

Are using npm@3? If so, it's related to #31

dbendy commented 8 years ago

No, actually we are still on npm@2. I assume that this has something to do with the fact that this module overrides the default npm install behavior: https://github.com/rxaviers/cldr-data-npm/blob/master/package.json#L29

rxaviers commented 8 years ago

This package has a post-install script (definition), which you are pointing at, not an install override. Anyway, the problem must have something to do with it. The post-install script is responsible for the actual JSON files downloads and it should avoid re-downloading when unnecessary: it's the rxaviers/cldr-data-downloader. In order to debug the issue, you could try using the downloader directly, pass the node_modules/cldr-data as destination for the download and check whether it prevents re-downloading the JSON files.