From d9175e8d03e0fc04e05c1bb72cab0e64c9427412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Tue, 30 May 2017 18:28:17 -0700 Subject: [PATCH] fix(exec): use command lookup joined with current PATH --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 5d7ded1..118b799 100755 --- a/index.js +++ b/index.js @@ -53,7 +53,10 @@ function getCmdPath (command, spec, npmOpts) { ).then(cache => { const prefix = path.join(cache, '_npx') return installPackage(spec, prefix, npmOpts).then(() => { - return path.join(prefix, 'bin', command) + process.env.PATH = `${ + path.join(prefix, 'bin') + }${PATH_SEP}${process.env.PATH}` + return which(command) }) }) }