Skip to content

Instantly share code, notes, and snippets.

@deepak1556
Created April 15, 2015 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepak1556/b6986a78ef25fd3c4098 to your computer and use it in GitHub Desktop.
Save deepak1556/b6986a78ef25fd3c4098 to your computer and use it in GitHub Desktop.
Remove system location for module lookups
commit 826f15a681380b1d074db2cdeed4c5d143c3a3da
Author: Robo <hop2deep@gmail.com>
Date: Thu Apr 16 00:08:56 2015 +0530
remove system location for module lookups
diff --git a/lib/module.js b/lib/module.js
index 79359da..c04778b 100644
--- a/lib/module.js
+++ b/lib/module.js
@@ -462,26 +462,8 @@ Module.runMain = function() {
};
Module._initPaths = function() {
- const isWindows = process.platform === 'win32';
-
- if (isWindows) {
- var homeDir = process.env.USERPROFILE;
- } else {
- var homeDir = process.env.HOME;
- }
-
var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node')];
- if (homeDir) {
- paths.unshift(path.resolve(homeDir, '.node_libraries'));
- paths.unshift(path.resolve(homeDir, '.node_modules'));
- }
-
- var nodePath = process.env['NODE_PATH'];
- if (nodePath) {
- paths = nodePath.split(path.delimiter).concat(paths);
- }
-
modulePaths = paths;
// clone as a read-only copy, for introspection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment