Skip to content

Commit 0224167

Browse files
committedOct 28, 2022
Use NPM_CLI_JS over npm_execpath
npm_execpath points to npx if you are running this inside of npx
1 parent bb41ef6 commit 0224167

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lib/run-task.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ module.exports = function runTask(task, options) {
154154
}
155155

156156
// Execute.
157-
const npmPath = options.npmPath || process.env.npm_execpath //eslint-disable-line no-process-env
157+
const npmPath = options.npmPath || process.env.NPM_CLI_JS || process.env.npm_execpath //eslint-disable-line no-process-env
158158
const npmPathIsJs = typeof npmPath === "string" && /\.m?js/.test(path.extname(npmPath))
159159
const execPath = (npmPathIsJs ? process.execPath : npmPath || "npm")
160160
const isYarn = process.env.npm_config_user_agent && process.env.npm_config_user_agent.startsWith("yarn") //eslint-disable-line no-process-env

0 commit comments

Comments
 (0)
Please sign in to comment.