Avinash,

If you have two npm install processes going in two separate folders,
it would previously cause all manner of badness.  (This is especially
important in build scripts and the like.)

For example:

(cd project-one ; npm install express) &
(cd project-two ; npm install express)

Now, whichever process gets there first will acquire a lock on the
cache folder, and the other will wait patiently for it to unlock or
expire.

There's still an edge case that isn't handled though:

(cd project-one ; npm install
https://github.com/visionmedia/express/tarball/master) &
(cd project-two ; npm install express@3.0)

Since the url and the name/version resolve to the same cache folder,
but are not the same thing (and npm doesn't realize that they're not
the same thing yet), they'll end up having different locks, and
clobber each other.  The solution is to lock on the target dir as well
once I know what it is.

The longer-term Correct solution is to refactor the npm caching and
fetching behavior considerably to be a fully streaming API.  There's
still a lot of legacy from using the system's tar(1) to pack and
unpack.



On Fri, Jun 29, 2012 at 10:37 AM, Avinash v <avinash.vadlam...@gmail.com> wrote:
> Thanks for the update, btw what is "Support for parallel use of the cache
> folder"  ?

Reply via email to