-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] npx@7
silently errors with could not determine executable to run
when trying to run a package bin script
#2877
Comments
I believe this was fixed in |
Just tried |
Same results from |
Same error, new stack trace. |
npx@7
silently errors when trying to run a package bin script where npx@6
had workednpx@7
silently errors with could not determine executable to run
when trying to run a package bin script
I don't know how this makes any sense, but it appears to have something to do with having a script named |
This is interesting because someone else reported a different issue that was fixed by renaming a |
Can you test this in |
This looks like it was fixed. ~/D/n/s/empty $ npx wraithgar/gar-create-test
Need to install the following packages:
github:wraithgar/gar-create-test
Ok to proceed? (y)
Gar's test create script version 2.0.3 |
Sorry, I spoke to soon, this doesn't appear to be fixed.
Kindly reopen. @wraithgar I suspect if you add a script named |
@wraithgar Kindly reopen. |
I have a similar problem after running 38 verbose stack Error: could not determine executable to run
38 verbose stack at getBinFromManifest (/usr/lib/node_modules/npm/node_modules/libnpmexec/lib/get-bin-from-manifest.js:17:23)
38 verbose stack at exec (/usr/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:173:15)
38 verbose stack at async module.exports (/usr/lib/node_modules/npm/lib/cli.js:78:5)
39 verbose pkgid gulp@4.0.2 If I add const getBinFromManifest = (mani) => {
// if we have a bin matching (unscoped portion of) packagename, use that
// otherwise if there's 1 bin or all bin value is the same (alias), use
// that, otherwise fail
const bin = mani.bin || {}
if (new Set(Object.values(bin)).size === 1) {
return Object.keys(bin)[0]
}
// XXX probably a util to parse this better?
const name = mani.name.replace(/^@[^/]+\//, '')
if (bin[name]) {
return name
}
// XXX need better error message
console.log('ERR WITH MANIFEST:', mani) // ADDED BY ME
throw Object.assign(new Error('could not determine executable to run'), {
pkgid: mani._id,
})
}
module.exports = getBinFromManifest Then I get in output: ERR WITH MANIFEST: {
version: '4.0.2',
resolved: 'https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz',
integrity: 'sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==',
dependencies: {
'glob-watcher': '^5.0.3',
'gulp-cli': '^2.2.0',
undertaker: '^1.2.1',
'vinyl-fs': '^3.0.0'
},
name: 'gulp',
_id: '[email protected]'
} npm@8.19.1
node@v18.8.0 Full log0 verbose cli /usr/bin/node /usr/lib/node_modules/npm/bin/npm-cli.js
1 info using npm@8.19.1
2 info using node@v18.8.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:/home/ilyaigpetrov/Projects/runet-censorship-bypass/extensions/chromium/runet-censorship-bypass/.npmrc Completed in 1ms
10 timing config:load:project Completed in 15ms
11 timing config:load:file:/home/ilyaigpetrov/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/usr/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 25ms
19 timing npm:load:configload Completed in 25ms
20 timing npm:load:mkdirpcache Completed in 1ms
21 timing npm:load:mkdirplogs Completed in 0ms
22 verbose title npm exec gulp -- buildAll
23 verbose argv "exec" "--" "gulp" "--" "buildAll"
24 timing npm:load:setTitle Completed in 2ms
25 timing config:load:flatten Completed in 4ms
26 timing npm:load:display Completed in 6ms
27 verbose logfile logs-max:10 dir:/home/ilyaigpetrov/.npm/_logs
28 verbose logfile /home/ilyaigpetrov/.npm/_logs/2022-09-05T16_25_42_196Z-debug-0.log
29 timing npm:load:logFile Completed in 7ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 43ms
33 silly logfile start cleaning logs, removing 1 files
34 silly logfile done cleaning log files
35 timing arborist:ctor Completed in 1ms
36 timing arborist:ctor Completed in 0ms
37 timing command:exec Completed in 564ms
38 verbose stack Error: could not determine executable to run
38 verbose stack at getBinFromManifest (/usr/lib/node_modules/npm/node_modules/libnpmexec/lib/get-bin-from-manifest.js:17:23)
38 verbose stack at exec (/usr/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:173:15)
38 verbose stack at async module.exports (/usr/lib/node_modules/npm/lib/cli.js:78:5)
39 verbose pkgid gulp@4.0.2
40 verbose cwd /home/ilyaigpetrov/Projects/runet-censorship-bypass/extensions/chromium/runet-censorship-bypass
41 verbose Linux 5.15.0-46-generic
42 verbose node v18.8.0
43 verbose npm v8.19.1
44 error could not determine executable to run
45 verbose exit 1
46 timing npm Completed in 726ms
47 verbose code 1
48 error A complete log of this run can be found in:
48 error /home/ilyaigpetrov/.npm/_logs/2022-09-05T16_25_42_196Z-debug-0.log |
My problem was fixed after installing sudo npm install --global gulp-cli |
Current Behavior:
Checking the logs, it looks like my script is failing with:
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:
npm@7
npx brianjenkins94/kerplow
Log
Expected Behavior:
For
npm@6
I get my example output (or it runsnpm init
if there's nopackage.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:
node
v15.11.0npm
v7.6.3The text was updated successfully, but these errors were encountered: