isaacs/npm — pull request #3506 by francoisfrisch (2013-06-01 01:41:22+00:00)
Title: use getCacheStat before lock, fixes #3821

Previous code did not handle the cache dir's permissions consistently.
If the first lock was done as sudo, the cache directory was not user
writable.