remove require.paths #1348

Closed
isaacs opened this Issue Jul 15, 2011 · 2 comments

Comments

Projects
None yet
2 participants

isaacs commented Jul 15, 2011

  1. Replace the require.paths array with a getter that throws a deprecation error.
  2. Still use NODE_PATH environment var to load modules globally, but only read once at startup, so that require.paths are not mutable.

@ry has okayed this change

isaacs was assigned Jul 15, 2011

isaacs closed this in 7f0047c Jul 15, 2011

barn3y commented Jul 24, 2011

Can someone explain the reason for this change? I'm sure there's a good one, but I can't find it.

isaacs commented Jul 25, 2011

The node docs explain some of the problems. The 0.4 docs should probably start saying that it IS gone in 0.5. http://nodejs.org/docs/v0.4.10/api/modules.html#_Note_Please_Avoid_Modifying_require.paths_

@isaacs isaacs added a commit to isaacs/node-v0.x-archive that referenced this issue Jul 25, 2011

@isaacs isaacs Close #1348 Remove require.paths
Module.globalPaths is still set to a read-only copy of the global
include paths pulled off of the NODE_PATH environment variable.

It's important to be able to inspect this, but modifying it no longer
has any effect.
bb2bc6f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment