立诚勿怠,格物致知
It's all about connecting the dots

Vite项目在Centos 7环境下报错Error: spawn xdg-open ENOENT

在IDEA连服务器远程编码时,发现vite项目在执行vite命令会报错。

node:events:504
      throw er; // Unhandled 'error' event
      ^

Error: spawn xdg-open ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn xdg-open',
  path: 'xdg-open',
  spawnargs: [ 'http://localhost:3001/' ]
}

Process finished with exit code 1

解决方案

在服务器上执行下面的命令即可。

yum install xdg-utils

 

赞(3) 打赏
文章名称:《Vite项目在Centos 7环境下报错Error: spawn xdg-open ENOENT》
文章链接:https://www.orzzone.com/vite-centos-7-vite-error-spawn-xdg-open-enoent.html
商业联系:yakima.public@gmail.com

本站大部分文章为原创或编译而来,对于本站版权文章,未经许可不得用于商业目的,非商业性转载请以链接形式标注原文出处。
本站内容仅供个人学习交流,不做为任何投资、建议的参考依据,因此产生的问题需自行承担。

评论 抢沙发

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力提供更多优质内容!

支付宝扫一扫打赏

微信扫一扫打赏

登录

找回密码

注册