xdg-open:没有可用于在服务器上打开'http:// localhost:9000'的方法

时间:2017-07-18 16:21:56

标签: express npm server gruntjs mean-stack

我正在使用带有IP http://192.241.160.194的云数字服务器与Dokku& OS Ubuntu 16.04。

我必须在此服务器上部署一个平均堆栈项目。在我的本地机器上,我使用grunt服务器来运行这个项目。在我的本地系统上,我正在使用Ubuntu 16.04。

在服务器上我已经成功安装了npm,bower,nodejs,grunt服务器和mongodb。但是当我想运行grunt服务器时。它给我以下错误。

Running "open:server" (open) task

Running "watch" task
Waiting...
Warning: Command failed: /bin/sh -c /root/Test/node_modules/open/vendor/xdg-open "http://localhost:9000"
Error: GDK_BACKEND does not match available displays
xdg-open: no method available for opening 'http://localhost:9000'

我尝试过这两个命令:

  1. grunt serve
  2. grunt serve --force
  3. 我还在服务器上安装了浏览器。还尝试重新安装grunt-cli但发现相同的错误。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

通常服务器没有图形库。所以我们无法在服务器上打开浏览器。我们需要运行也将运行grunt的快速服务器。用于运行快速服务器。 将应用程序放入生产和运行命令 node ./server