-
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 fails to run some commands #1955
Comments
There might be an install bug here. Trying to |
npm6 this works fine. both install and exec. |
Its seems like its only failing on packages that have |
same here with npx 7.0.2. I'm also using nvm on linux (debian) but with node 15 npx serve
(NB: serve does not have |
@jsg2021 i don't suppose you've seen this happen with a public module? also, we did release some fixes related to auth of private registries, does this still happen for you in 7.0.5? @t-fritsch i'm not able to reproduce that one in 7.0.5 either, can you try updating and let me know if it fixes it? |
thank you @nlf, unfortunately I just tried with 7.0.5 and still get the same error message |
can you share more details? are you running |
yes of course :
cat /home/xxxxxxxxx/.npm/_logs/2020-10-27T15_25_12_235Z-debug.log0 verbose cli [ 0 verbose cli '/home/xxxxxxxxxx/.nvm/versions/node/v15.0.1/bin/node', 0 verbose cli '/home/xxxxxxxxxx/.nvm/versions/node/v15.0.1/lib/node_modules/npm/bin/npm-cli.js', 0 verbose cli 'exec', 0 verbose cli '--', 0 verbose cli 'serve' 0 verbose cli ] 1 info using npm@7.0.5 2 info using node@v15.0.1 3 timing config:load:defaults Completed in 2ms 4 timing config:load:file:/home/xxxxxxxxxx/.nvm/versions/node/v15.0.1/lib/node_modules/npm/npmrc Completed in 2ms 5 timing config:load:builtin Completed in 2ms 6 timing config:load:cli Completed in 2ms 7 timing config:load:env Completed in 0ms 8 timing config:load:file:/home/xxxxxxxxxx/tmp/.npmrc Completed in 0ms 9 timing config:load:project Completed in 2ms 10 timing config:load:file:/home/xxxxxxxxxx/.npmrc Completed in 1ms 11 timing config:load:user Completed in 1ms 12 timing config:load:file:/home/xxxxxxxxxx/.nvm/versions/node/v15.0.1/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 2ms 16 timing config:load:setUserAgent Completed in 1ms 17 timing config:load:setEnvs Completed in 1ms 18 timing config:load Completed in 15ms 19 verbose npm-session bc119059f77a1875 20 timing npm:load Completed in 26ms 21 http fetch GET 304 http://registry.npmjs.org/serve 97ms (from cache) 22 timing arborist:ctor Completed in 0ms 23 timing arborist:ctor Completed in 0ms 24 timing command:exec Completed in 173ms 25 verbose stack Error: command failed 25 verbose stack at ChildProcess. (/home/xxxxxxxxxx/.nvm/versions/node/v15.0.1/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:63:27) 25 verbose stack at ChildProcess.emit (node:events:327:20) 25 verbose stack at maybeClose (node:internal/child_process:1048:16) 25 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:288:5) 26 verbose cwd /home/xxxxxxxxxx/tmp 27 verbose Linux 4.19.0-12-amd64 28 verbose argv "/home/xxxxxxxxxx/.nvm/versions/node/v15.0.1/bin/node" "/home/xxxxxxxxxx/.nvm/versions/node/v15.0.1/lib/node_modules/npm/bin/npm-cli.js" "exec" "--" "serve" 29 verbose node v15.0.1 30 verbose npm v7.0.5 31 error code 127 32 error path /home/xxxxxxxxxx/tmp 33 error command failed 34 error command sh -c serve 35 verbose exit 127 |
We are seeing the same issue for two other packages as well: I don't think this is to do with multiple different registries being used as I can replicate the issue when using only the public npmjs registry. Here is the github workflow build which fails when using npmjs public registry directly Here is the github workflow build which fails when using a proxy npm registry The issue looks to be a failure in linking the binary file to the node_modules/.bin directory. Here is the commands and out I used to get to that conclusion, they should be reproducible for anyone to run:
|
@nlf I tried to recreate my private packages on the public registry gutted... but I couldn't get any I publish to fail. But, my existing (internal registry) packages still fail with command not found. So this made me try just publishing a new version... and the new published packages on the internal registry work. (I've done all this on 7.0.8 today) I tested |
given that, as well as the confirmation that other packages seem to be working correctly, i'm going to close this issue |
Previous versions of npm worked fine with the same oax and scrumple version, do you know why that would be? |
Some background:
I'm trying to update a workflow where I had
npx @scope/thing
and it would happilly download the package and run it. I've added--yes
to the workflow and many times this was enough. Some casesthing
pre-existed and I needed to ignore the local version. So we added--ignore-existing
in npm6. For that case... all of these are on a private registry.Current Behavior:
With npm7's exec/npx, several packages are failing to run. Here is some log output...
Log `npx --loglevel silly --yes -p @nti/clone -c 'clone'`
Log `npx --loglevel silly --yes -p @nti/clone@latest -c 'clone'`
Expected Behavior:
The package downloads/runs.
Steps To Reproduce:
Run npx on a simple package in a private scope. Mine was
@nti/clone
and@nti/fix
. These are command-line tools that automate things...Environment:
The text was updated successfully, but these errors were encountered: