dominictarr / npmd

MIT License
450 stars 37 forks source link

Discussion: Offline dependency resolution strategy #25

Closed DamonOehlman closed 10 years ago

DamonOehlman commented 10 years ago

I just pulled the plug on my local network and tried to npmd-all-the-things in a few of my local project folders.

The result of my attempted reinstall, however, was failure for some packages. This is probably reasonable and correct behaviour, but I'm wondering if there is the possibility of making npmd a little more tolerant / flexible (within reason).

While each of the folders had been synced previously while online some time had passed sinced I did that. Therefore I imagine the background npmd --sync job picked up newer versions of some the dependant packages.

I'm wondering in the case where the latest version of a package in npm (and thus known to npmd) differs by only the patch version and thus still satisfies ~1.2.3 whether an older cached version could be used if network connectivity is unavailable.

dominictarr commented 10 years ago

yes, both of these.u

  1. I want npmd to download new versions of modules that you use in the background*
  2. But also, it's necessary to try to resolve modules that you can actually install, for when you install offline, because there will always be some cases where you havn't synced the tarball yet.

for 2 we'll need an index of what is in the cache. It will probably be easier to fix 2 first, because you'll encounter the edgecase of 1 less often until you try using it in a airplane or something.

@substack is also interested in this problem. Also he's been working on doing an offline publish!

dominictarr commented 10 years ago
DamonOehlman commented 10 years ago

All of that sounds awesome - really like where this is headed! Will definitely pitch in where I can :)

dominictarr commented 10 years ago

this is fixed. use npmd install MODULE --offline and it will resolve the deps using your ~/.npm cache, and thus will only try modules that you already have.

DamonOehlman commented 10 years ago

Awesome mate - thanks for your hard work on this :)