stickyboot•

Node path is depreciated. You shouldn't use it.

1
inxilproOP•

Where does it say deprecated? The docs state:

NODE_PATH is still supported, but is less necessary now that the Node.js ecosystem has settled on a convention for locating dependent modules.

1
stickyboot•

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.

1
stickyboot•

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

1
inxilproOP•

Upon further investigation, the Node Technical Steering Committee voted in May on NODE_PATH and decided not to deprecate it.

1
aeflash•

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)?

1