moduleDirectories vs modulePaths
Documentation Is:
- [ ] Missing
- [ ] Needed
- [x] Confusing
- [ ] Not Sure?
Please Explain in Detail...
The descriptions for the two are not meaningfully different, in addition the link to NODE_PATH doesn't work and (assuming I found the current documentation) says roughly the same thing as the other two.
I looked at the code and AFAICT moduleDirectories identifies stopping directories when trying to find the package.json for a specific json file (i.e. it stops going up looking for further directories at that point). This surprises me because it seems to have nothing to do with the current description in the documentation, but somewhat explains why / is forbidden (it would also be helpful if the error message mentioned / explicitly since "name" does not always imply a single path segment).
Having read the code, I'd guess that if you specify a/b/c as a modulePaths element, moduleDirectories should include c for the same reason it by default includes node_modules.