Allow installing packages from git subdirectories

Migrating here this feature request from npm/npm on GitHub:

PS: that issue will show up in search results for a long while, given its number of :+1:s, :heart:s and comments. It would be great if the original post were amended to point to this thread (might require un-archiving the repo temporarily but I think it’s worth the effort).