Clear node's global search paths
This commit is contained in:
parent
021ee20400
commit
9fe326ebeb
3 changed files with 8 additions and 17 deletions
|
@ -9,18 +9,9 @@ process.atomBinding = (name) ->
|
|||
catch e
|
||||
process.binding "atom_common_#{name}" if /No such module/.test e.message
|
||||
|
||||
# Global module search paths.
|
||||
# Clear node's global search paths.
|
||||
globalPaths = Module.globalPaths
|
||||
|
||||
# Don't lookup modules in user-defined search paths, see http://git.io/vf8sF.
|
||||
homeDir =
|
||||
if process.platform is 'win32'
|
||||
process.env.USERPROFILE
|
||||
else
|
||||
process.env.HOME
|
||||
if homeDir # Node only add user-defined search paths when $HOME is defined.
|
||||
userModulePath = path.resolve homeDir, '.node_modules'
|
||||
globalPaths.splice globalPaths.indexOf(userModulePath), 2
|
||||
globalPaths.length = 0
|
||||
|
||||
# Add common/api/lib to module search paths.
|
||||
globalPaths.push path.resolve(__dirname, '..', 'api', 'lib')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue