Error: spawn xdg-open ENOENT

报错:The CJS build of Vite’s Node API is deprecated. See
https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated
for more details.

VITE v5.1.4 ready in 2298 ms

➜ Local: http://localhost:80/ ➜ Network: http://10.0.4.13:80/
➜ press h + enter to show help node:events:491
throw er; // Unhandled ‘error’ event
^

Error: spawn xdg-open ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476: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:289:12)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -2, code:
‘ENOENT’, syscall: ‘spawn xdg-open’, path: ‘xdg-open’,
spawnargs: [ ‘http://localhost:80/’ ] }

如果你的系统没有 apt-get 命令,可能是因为你使用的不是Debian系的Linux发行版(如Ubuntu),而是其他类型的Linux发行版,或者是Windows或macOS系统。以下是针对不同系统的解决方案:

对于不同的Linux版本,安装 xdg-utils 包
  • Red Hat系Linux(如Fedora、CentOS)

    sudo yum install xdg-utils
    

    在较新的系统上

    sudo dnf install xdg-utils
    
  • Arch系Linux

    sudo pacman -S xdg-utils
    

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-11 07:34:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-11 07:34:03       100 阅读
  3. 在Django里面运行非项目文件

    2024-06-11 07:34:03       82 阅读
  4. Python语言-面向对象

    2024-06-11 07:34:03       91 阅读

热门阅读

  1. go可扩展有哪些方式

    2024-06-11 07:34:03       33 阅读
  2. R语言:使用 tidyr 进行数据整理

    2024-06-11 07:34:03       37 阅读
  3. C#——Math 数学函数详情

    2024-06-11 07:34:03       35 阅读
  4. 【Spring Boot】Spring Boot 的世界之旅1

    2024-06-11 07:34:03       30 阅读
  5. Toast.makeText() 使用方法

    2024-06-11 07:34:03       30 阅读
  6. 设计模式之组合模式

    2024-06-11 07:34:03       24 阅读
  7. 速盾:图片cdn加速 免费

    2024-06-11 07:34:03       31 阅读
  8. react+wijmo所遇问题

    2024-06-11 07:34:03       35 阅读
  9. 电商项目-day01

    2024-06-11 07:34:03       37 阅读