isaacs/npm — pull request #4214 by domenic (2013-11-28 04:18:44+00:00)
Title: Fix incorrect is-inside-a-directory checking.

This caused me serious problems when my npm config had the cache location set to `C:\Users\Domenic\AppData\Roaming\npm-cache`, but my `process.cwd()` value was `c:\Users\...`, i.e. the drive letter casing was mismatched.

In general, the problem was that is-inside-this-directory checking was done with `potentialChild.indexOf(parent) === 0`, which fails for case-insensitive filesystems. Anyone who had manually configured their cache or tmp location, without matching the system's casing exactly, would have run into this problem.

In particular, the failure to use the correct detection method caused npm to try to run prepublish scripts for *everything*.

Why did this manifest now? It may be a Node 0.11 issue, or perhaps a Windows 8.1 one. My other computer, running Node 0.10 and Windows 8, does not exhibit the lowercase `process.cwd()` value.