[BUG] `npx@7` silently errors with `could not determine executable to run` when trying to run a package bin script
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
[!] The title may be misleading. I am using the version of `npx` that comes with `npm`,
not the version you have to install via `npm install -g npx`.
Current Behavior:
$ npx brianjenkins94/kerplow
Need to install the following packages:
github:brianjenkins94/kerplow
Ok to proceed? (y) y
$
Checking the logs, it looks like my script is failing with:
23 verbose stack Error: could not determine executable to run
23 verbose stack at Exec.getBinFromManifest (/usr/local/lib/node_modules/npm/lib/exec.js:272:25)
23 verbose stack at Exec._exec (/usr/local/lib/node_modules/npm/lib/exec.js:138:22)
24 verbose cwd /Users/bjenks/.npm/_cacache/tmp/git-clone-e17c5452
Surely that should have errored to the console, right?
Receiving nothing wasn't particularly helpful. Maybe instead it could tell me where it tried to run, what it tried to run and where it didn't find it?
Steps To Reproduce:
- In any environment where
npm@7 npx brianjenkins94/kerplow- Nothing happens
Log
0 verbose cli [
0 verbose cli '/usr/local/Cellar/node/15.11.0/bin/node',
0 verbose cli '/usr/local/lib/node_modules/npm/bin/npm-cli.js',
0 verbose cli 'exec',
0 verbose cli '--',
0 verbose cli 'install',
0 verbose cli '--force',
0 verbose cli '--cache=/Users/bjenks/.npm',
0 verbose cli '--prefer-offline=false',
0 verbose cli '--prefer-online=false',
0 verbose cli '--offline=false',
0 verbose cli '--no-progress',
0 verbose cli '--no-save',
0 verbose cli '--no-audit'
0 verbose cli ]
1 info using npm@7.6.3
2 info using node@v15.11.0
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 2ms
5 timing config:load:builtin Completed in 2ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/Users/bjenks/.npm/_cacache/tmp/git-clone-e17c5452/.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/Users/bjenks/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/usr/local/etc/npmrc Completed in 1ms
13 timing config:load:global Completed in 1ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 1ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 7ms
19 verbose npm-session 47f8ff11c5fadcf7
20 timing npm:load Completed in 17ms
21 http fetch GET 304 https://registry.npmjs.org/install 1104ms (from cache)
22 timing command:exec Completed in 1120ms
23 verbose stack Error: could not determine executable to run
23 verbose stack at Exec.getBinFromManifest (/usr/local/lib/node_modules/npm/lib/exec.js:272:25)
23 verbose stack at Exec._exec (/usr/local/lib/node_modules/npm/lib/exec.js:138:22)
24 verbose cwd /Users/bjenks/.npm/_cacache/tmp/git-clone-e17c5452
25 verbose Darwin 19.6.0
26 verbose argv "/usr/local/Cellar/node/15.11.0/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "exec" "--" "install" "--force" "--cache=/Users/bjenks/.npm" "--prefer-offline=false" "--prefer-online=false" "--offline=false" "--no-progress" "--no-save" "--no-audit"
27 verbose node v15.11.0
28 verbose npm v7.6.3
29 error could not determine executable to run
30 verbose exit 1
Expected Behavior:
For npm@6 I get my example output (or it runs npm init if there's no package.json in the current directory).
Is there a migration guide I missed or something? Is this change in behavior expected?
Looks like this is what I missed 🤔: https://blog.npmjs.org/post/626173315965468672/npm-v7-series-beta-release-and-semver-major
Environment:
- Darwin 19.6.0
nodev15.11.0npmv7.6.3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in npm/lib/exec.js at Exec.getBinFromManifest and Exec._exec, then reproduce the npx brianjenkins94/kerplow command with the stated Node and npm versions. Trace why the executable error is not shown to the user; done means the failed bin lookup produces useful console output consistent with the reported expected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100