We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 385125b commit 2b31591Copy full SHA for 2b31591
lib/index.js
@@ -36,6 +36,7 @@ var fs = require('fs');
36
var exists = fs && fs.existsSync;
37
var resolve = path && path.resolve;
38
var isWindows;
39
+var isElectron;
40
var isGlobal;
41
var globals;
42
var cwd;
@@ -49,7 +50,8 @@ if (typeof global !== 'undefined') {
49
50
51
/* Detect whether we’re running as a globally installed package. */
52
isWindows = global.process.platform === 'win32';
- isGlobal = global.process.argv[1].indexOf(npmPrefix) === 0;
53
+ isElectron = global.process.versions.electron !== undefined;
54
+ isGlobal = isElectron || global.process.argv[1].indexOf(npmPrefix) === 0;
55
56
/* istanbul ignore next */
57
globals = resolve(npmPrefix, isWindows ? '' : 'lib', MODULES);
0 commit comments