[英]How to resolve clipboard error while deploying vuejs app on ubuntu server
I am deploying a vuejs app on my server.we have EC2 instance with ubuntu 16.04,As of now I am just deploying my test project but when I go running serve command like sudo serve -s dist
but it is throwing an error which is: ERROR: Cannot copy to clipboard: Command failed: xsel --clipboard --input xsel: Can't open display: (null): Inappropriate ioctl for device
I don't know this error is caused by ubuntu or vuejs please help me solve it.我正在我的服务器上部署一个 vuejs 应用程序。我们有 ubuntu 16.04 的 EC2 实例,截至目前我只是部署我的测试项目但是当我 go 运行像
sudo serve -s dist
这样的服务命令但它抛出一个错误是: ERROR: Cannot copy to clipboard: Command failed: xsel --clipboard --input xsel: Can't open display: (null): Inappropriate ioctl for device
我不知道这个错误是由 ubuntu 或 vuejs 引起的请帮我解决它。
I have followed these cammands so far.到目前为止,我一直遵循这些命令。
First installed vue cli using npm install -g @vue/cli
首先使用
npm install -g @vue/cli
Then created a hello world app using vue create helloWorld
然后使用
vue create helloWorld
创建了一个 hello world 应用程序
Now run serve command npm run serve
现在运行服务命令
npm run serve
It was showing me a message like:它向我显示了一条消息,例如:
App running at: - Local: http://localhost:8081/ - Network: http://172.31.16.66:8081/
Now i have created a build to run an app on the production server npm run build
现在我已经创建了一个构建来在生产服务器上运行一个应用程序
npm run build
So my build was created successfully i run command to run the app on the live server所以我的构建已成功创建我运行命令以在实时服务器上运行应用程序
serve -s dist
And it is throwing an error which is not solving by me so far它抛出了一个错误,到目前为止我还没有解决
WARNING: Checking for updates failed (use
--debug to see full error) ERROR: Cannot copy to clipboard: Command failed: xsel --clipboard --input xsel: Can't open display: (null): Inappropriate ioctl for device
WARNING: Checking for updates failed (use
--debug to see full error) ERROR: Cannot copy to clipboard: Command failed: xsel --clipboard --input xsel: Can't open display: (null): Inappropriate ioctl for device
I am also attaching screenshot below.我还在下面附上截图。
As you can see, there is an X11 dependency with the serve
module - which means you need an xserver(display) for it to work. 正如您所看到的,
serve
模块存在X11依赖关系 - 这意味着您需要一个xserver(显示)才能工作。
Alternatively, ( highly recommended ) you could use a high performance HTTP server like nginx , apache etc. instead. 或者,( 强烈推荐 )您可以使用高性能HTTP服务器,如nginx , apache等。
All you need is to copy your dist folder to your instance, and point your virtual server block to the dist
dir, and restart your HTTP server - BAM! 您只需将dist文件夹复制到您的实例,并将虚拟服务器块指向
dist
目录,然后重新启动HTTP服务器 - BAM! you're up and running. 你已经开始运转了。
Cheers! 干杯!
I had the same issue and I solved it by adding "-n" option to serve.我有同样的问题,我通过添加“-n”选项来解决它。
"-n, --no-clipboard Do not copy the local address to the clipboard" "-n, --no-clipboard 不要将本地地址复制到剪贴板"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.