Fixes crash when package only has `devDependencies` field.
When running `npm install` in a package, if one of the deps depends on the root package, it might not be require()-able (if the folder name doens't match, and/or if it's not in a node_modules folder). This makes that work. Originally by @SubStack, edited slightly by @isaacs. * failing test for pkg.name that can't be required * fix the false_name test by altering data.name when it's not in a requirable location * set data.name to null for unrequirable packages, less hackishly
This reverts commit 391b8a3. This causes problems on unix when running the tests, which is much more common. The test runner needs to probably just be redone in a better way. It's old and janky, and has been ported from bash to js, but ought to be replaced with something that exercises npm's functionality in a more proper way.
This is necessary on Windows; otherwise you get 2> 'c:\PROGRAM' is not recognized as an internal or external command, 2> operable program or batch file. since Node/npm are in "C:\Program Files (x86)\nodejs", which has spaces in it.