Skip to content
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] sh: 1: xdg-open: not found #5903

Closed
2 tasks done
bnb opened this issue Nov 29, 2022 · 3 comments · Fixed by npm/promise-spawn#57
Closed
2 tasks done

[BUG] sh: 1: xdg-open: not found #5903

bnb opened this issue Nov 29, 2022 · 3 comments · Fixed by npm/promise-spawn#57
Assignees
Labels
Bug thing that needs fixing Priority 0 will get attention right away Release 9.x work is associated with a specific npm 9 release

Comments

@bnb
Copy link
Contributor

bnb commented Nov 29, 2022

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Running npm publish fails because xdg-open is not installed.

❯ npm publish
npm notice 
npm notice 📦  bitandbang@3.0.1
npm notice === Tarball Contents === 
npm notice 1.1kB LICENSE     
npm notice 293B  README.md   
npm notice 233B  bin/card.js 
npm notice 1.8kB bin/output  
npm notice 914B  package.json
npm notice === Tarball Details === 
npm notice name:          bitandbang                              
npm notice version:       3.0.1                                   
npm notice filename:      bitandbang-3.0.1.tgz                    
npm notice package size:  1.8 kB                                  
npm notice unpacked size: 4.3 kB                                  
npm notice shasum:        e41e2f220aab4bac285b1c92b77529028be79442
npm notice integrity:     sha512-uopvx5yoKCJmR[...]v/TqtK3drTsSA==
npm notice total files:   5                                       
npm notice 
npm notice Publishing to https://registry.npmjs.org/ with tag latest and default access
Authenticate your account at:
https://www.npmjs.com/auth/cli/7bc3930c-17c0-4537-8ec1-d8f724859741
Press ENTER to open in the browser...
npm ERR! code 127
npm ERR! command failed
npm ERR! command sh -c xdg-open https://www.npmjs.com/auth/cli/npm_***
npm ERR! sh: 1: xdg-open: not found

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/bnb/.npm/_logs/2022-11-29T06_42_23_988Z-debug-0.log

Expected Behavior

Running npm publish works

Steps To Reproduce

  1. Use WSL2 with Ubuntu
  2. Use fnm to install Node.js
  3. Update npm with npm i -g npm
  4. Try to publish a module

Environment

  • npm: 9.1.2
  • Node.js: 19.1.0
  • OS Name: Windows / WSL2 (Ubuntu)
  • npm config:
; "user" config from /home/bnb/.npmrc

//registry.npmjs.org/:_authToken = (protected) 

; "project" config from /home/bnb/GitHub/bnb/bitandbang/.npmrc

package-lock = false 

; "cli" config from command line options

location = "project" 

; node bin location = /home/bnb/.local/share/fnm/node-versions/v19.1.0/installation/bin/node
; node version = v19.1.0
; npm local prefix = /home/bnb/GitHub/bnb/bitandbang
; npm version = 9.1.2
; cwd = /home/bnb/GitHub/bnb/bitandbang
; HOME = /home/bnb
; Run `npm config ls -l` to show all defaults.
@bnb bnb added Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release labels Nov 29, 2022
@bnb
Copy link
Contributor Author

bnb commented Nov 29, 2022

logfile output:

0 verbose cli /home/bnb/.local/share/fnm/node-versions/v19.1.0/installation/bin/node /mnt/wslg/runtime-dir/fnm_multishells/27976_1669703149802/bin/npm
1 info using npm@9.1.2
2 info using node@v19.1.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/home/bnb/.local/share/fnm/node-versions/v19.1.0/installation/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 0ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:/home/bnb/GitHub/bnb/bitandbang/.npmrc Completed in 1ms
10 timing config:load:project Completed in 3ms
11 timing config:load:file:/home/bnb/.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:/home/bnb/.local/share/fnm/node-versions/v19.1.0/installation/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 1ms
16 timing config:load Completed in 8ms
17 timing npm:load:configload Completed in 8ms
18 timing npm:load:mkdirpcache Completed in 0ms
19 timing npm:load:mkdirplogs Completed in 0ms
20 verbose title npm publish
21 verbose argv "publish"
22 timing npm:load:setTitle Completed in 1ms
23 timing config:load:flatten Completed in 2ms
24 timing npm:load:display Completed in 2ms
25 verbose logfile logs-max:10 dir:/home/bnb/.npm/_logs/2022-11-29T06_42_23_988Z-
26 verbose logfile /home/bnb/.npm/_logs/2022-11-29T06_42_23_988Z-debug-0.log
27 timing npm:load:logFile Completed in 3ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 15ms
31 silly logfile start cleaning logs, removing 1 files
32 timing config:load:flatten Completed in 0ms
33 verbose publish [ '.' ]
34 silly logfile done cleaning log files
35 timing arborist:ctor Completed in 0ms
36 timing arborist:ctor Completed in 0ms
37 notice
38 notice 📦  bitandbang@3.0.1
39 notice === Tarball Contents ===
40 notice 1.1kB LICENSE     
40 notice 293B  README.md   
40 notice 233B  bin/card.js 
40 notice 1.8kB bin/output  
40 notice 914B  package.json
41 notice === Tarball Details ===
42 notice name:          bitandbang                              
42 notice version:       3.0.1                                   
42 notice filename:      bitandbang-3.0.1.tgz                    
42 notice package size:  1.8 kB                                  
42 notice unpacked size: 4.3 kB                                  
42 notice shasum:        e41e2f220aab4bac285b1c92b77529028be79442
42 notice integrity:     sha512-uopvx5yoKCJmR[...]v/TqtK3drTsSA==
42 notice total files:   5                                       
43 notice
44 notice Publishing to https://registry.npmjs.org/ with tag latest and default access
45 http fetch PUT 401 https://registry.npmjs.org/bitandbang 275ms
46 http fetch GET 202 https://registry.npmjs.org/-/v1/done?authId=npm_*** 138ms
47 timing command:publish Completed in 1849ms
48 verbose stack Error: command failed
48 verbose stack     at ChildProcess.<anonymous> (/home/bnb/.local/share/fnm/node-versions/v19.1.0/installation/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
48 verbose stack     at ChildProcess.emit (node:events:513:28)
48 verbose stack     at maybeClose (node:internal/child_process:1098:16)
48 verbose stack     at Socket.<anonymous> (node:internal/child_process:456:11)
48 verbose stack     at Socket.emit (node:events:513:28)
48 verbose stack     at Pipe.<anonymous> (node:net:298:12)
49 verbose cwd /home/bnb/GitHub/bnb/bitandbang
50 verbose Linux 5.15.74.2-microsoft-standard-WSL2
51 verbose node v19.1.0
52 verbose npm  v9.1.2
53 error code 127
54 error command failed
55 error command sh -c xdg-open https://www.npmjs.com/auth/cli/npm_***
56 error sh: 1: xdg-open: not found
57 verbose exit 127
58 timing npm Completed in 1877ms
59 verbose code 127
60 error A complete log of this run can be found in:
60 error     /home/bnb/.npm/_logs/2022-11-29T06_42_23_988Z-debug-0.log

@nlf nlf removed the Needs Triage needs review for next steps label Nov 30, 2022
@nlf
Copy link
Contributor

nlf commented Nov 30, 2022

this looks like https://github.com/npm/promise-spawn/blob/main/lib/index.js#L134-L136 isn't working, WSL should be using the windows start command. can you tell me what node -p "require('os').release()" prints?

@nlf nlf added Priority 1 high priority issue Priority 0 will get attention right away and removed Priority 1 high priority issue labels Nov 30, 2022
nlf added a commit to npm/promise-spawn that referenced this issue Dec 12, 2022
@bnb
Copy link
Contributor Author

bnb commented Dec 13, 2022

Sorry for not getting back to you sooner in this @nlf, thanks for the fix ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 0 will get attention right away Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants