You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Paths set in NODE_PATH are not available in the browser process #11
I'm trying to move the classes in main.coffee into multiple files, but the browser process's require doesn't know about the paths set on NODE_PATH. This even fails when the first thing main.coffee does is set the NODE_PATH env variable.
When the main.coffee is loaded, the NODE_PATH has already been read and stored by the module system, so subsequent modifications to NODE_PATH won't have any effect on current script.
To modify the module's search paths in main.coffee, you should append the paths to require('module').globalPaths:
require('module').globalPaths.push(searchPath);
This feature (modify the search paths after script is loaded) is atom-shell only, I'll document it.
Activity
zcbenz commentedon May 18, 2013
When the
main.coffeeis loaded, theNODE_PATHhas already been read and stored by the module system, so subsequent modifications toNODE_PATHwon't have any effect on current script.To modify the module's search paths in
main.coffee, you should append the paths torequire('module').globalPaths:This feature (modify the search paths after script is loaded) is atom-shell only, I'll document it.
probablycorey commentedon May 20, 2013
Do you think we should use module.globalPaths instead of NODE_PATH for everything? It would be more consistent, but are there are downsides?
zcbenz commentedon May 21, 2013
module.globalPathsdoes not work in the renderer, because of a hack that forcing module code to be evaluated under window context.probablycorey commentedon May 23, 2013
I can't get module.globalPaths to work in the browser process.
I run this code in main.coffee
And this is the output
zcbenz commentedon May 24, 2013
The
~/github/atomonly contains.coffeesources, so you have to requirecoffee-script:probablycorey commentedon May 24, 2013
Ahh, thanks!
Merge pull request #11 from atom/master
Merge pull request #11 from electron/master
Disable devtools (electron#11)
Update libchromiumcontent for Windows support
Update libchromiumcontent for Windows support
release-notifier commentedon Jan 31, 2018
This PR landed in electron v1.7.12 🎉
Merge pull request #11 from electron/ci