Use NODE_PATH to simplify module loading from outside of node_modules
github.com/inxilpro/enforce-node-pathPosted Oct 22, 2015, 1:55 PM UTC
06
Posted Oct 22, 2015, 1:55 PM UTC
I dont like using it because it leads to ambiguity.
var bar = require("foo/bar")
Am I loading something from the "foo" node module, or something from lib/ (or wherever NODE_PATH happens to be defined)?
Node path is depreciated. You shouldn't use it.
Where does it say deprecated? The docs state:
Thanks for finding the updated situation. During one of the many iojs meetings, there was discussion of it being depreciated, but given its historical existence and wide use, I can understand why they changed the policy.
I would still recommend against using it or encouraging others to use it. Projects are easier to maintain and more reliable with a fully defined package.json and local modules in node_modules.
Ahh yeah, It was decided that it would be depreciated, but then they it was decided it wouldn't, but that it should be clear that people shouldn't use it:
Full discussion here.
https://github.com/nodejs/node/issues/1627
Upon further investigation, the Node Technical Steering Committee voted in May on NODE_PATH and decided not to deprecate it.