Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

remove require.paths #1348

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

remove require.paths #1348

isaacs opened this issue Jul 15, 2011 · 2 comments
Assignees

Comments

@isaacs
Copy link

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

@ghost ghost assigned isaacs Jul 15, 2011
@isaacs isaacs closed this as completed in 7f0047c Jul 15, 2011
@chrisbnt
Copy link

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

@isaacs
Copy link
Author

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 added a commit to isaacs/node-v0.x-archive that referenced this issue Jul 25, 2011
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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants