Skip to content
This repository was archived by the owner on Apr 7, 2021. It is now read-only.

Commit f185d0d

Browse files
committed
fix(binpath): fix calling binaries from subdirectories
1 parent 98288d8 commit f185d0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ function npx (argv) {
115115
module.exports._localBinPath = localBinPath
116116
function localBinPath (cwd) {
117117
return require('./get-prefix.js')(cwd).then(prefix => {
118-
return promisify(fs.stat)('package.json').then(
118+
const pkgjson = path.join(prefix, 'package.json')
119+
return promisify(fs.stat)(pkgjson).then(
119120
() => path.join(prefix, 'node_modules', '.bin'),
120121
err => { if (err.code !== 'ENOENT') throw err }
121122
)

0 commit comments

Comments
 (0)