WordPress / playground-tools

GNU General Public License v2.0
127 stars 38 forks source link

Error: spawn xdg-open ENOENT #38

Open khromov opened 1 year ago

khromov commented 1 year ago

I was trying to start wp-now but was getting the below error. This was resolved by running apt-get install xdg-utils. If this is a requirement it would be good if the command warned you about it instead of just crashing.

k@DESKTOP:~$ node --version
v19.8.1
k@DESKTOP:~$ npm install -g @wp-now/wp-now

added 122 packages in 21s

13 packages are looking for funding
  run `npm fund` for details
npm notice
npm notice New minor version of npm available! 9.5.1 -> 9.6.7
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.7
npm notice Run npm install -g npm@9.6.7 to update!
npm notice
k@DESKTOP:~$ wp-now start
Starting the server......
directory: /home/k
mode: playground
php: 8.0
wp: latest
Downloading WordPress latest...
Downloading SQLite...
Server running at http://127.0.0.1:8881/
node:events:490
      throw er; // Unhandled 'error' event
      ^

Error: spawn xdg-open ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:483:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:291:12)
    at onErrorNT (node:internal/child_process:483:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn xdg-open',
  path: 'xdg-open',
  spawnargs: [ 'http://127.0.0.1:8881/' ]
}
Supportic commented 1 year ago

Experiencing the same. WIN WSL2