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 66459f9 commit d6da190Copy full SHA for d6da190
index.js
@@ -85,7 +85,7 @@ function lifecycle (pkg, stage, wd, opts) {
85
const env = makeEnv(pkg, opts)
86
env.npm_lifecycle_event = stage
87
env.npm_node_execpath = env.NODE = env.NODE || process.execPath
88
- env.npm_execpath = require.main.filename
+ env.npm_execpath = require.main ? require.main.filename : process.cwd()
89
env.INIT_CWD = process.cwd()
90
env.npm_config_node_gyp = env.npm_config_node_gyp || DEFAULT_NODE_GYP_PATH
91
if (opts.extraEnv) {
0 commit comments