简体   繁体   English

如何在 ubuntu 服务器上部署 vuejs 应用程序时解决剪贴板错误

[英]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服务器,如nginxapache等。

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.

相关问题 将 docker 镜像部署到云运行时如何解决“容器启动失败错误” - How to resolve "container failed to start error" while deploying a docker image to cloud run “errorMessage”:在 AWS 无服务器上部署时“server.app.use 不是一个函数” - "errorMessage": "server.app.use is not a function" while deploying on AWS serverless 如何在部署 Python Bottle 服务器时通过 AWS App Runner 的健康检查测试? - How to pass health check tests on AWS App Runner while deploying Python Bottle server? 安装pyrebase时如何解决这个错误? - How to resolve this error while installing pyrebase? 部署到亚洲地区时如何防止 App Engine 构建超时 - How to prevent App Engine Build timeout while deploying to asia region 从 GitLab CI 将应用程序部署到 App Engine 时权限被拒绝 - Permission denied while deploying an app to App Engine from GitLab CI 部署 firebase 函数时如何修复“ERESOLVE 无法解析” - How to fix "ERESOLVE could not resolve" when deploying firebase functions 在 App Engine 中部署 Django 时出现 OSError - OSError while deploying Django in App Engine 通过 beantalk 部署节点应用程序时的“无数据”健康状态 - "no data" health status while deploying node app via beanstalk 部署到 AWS amplify 时出现构建错误 - Building error while deploying to AWS amplify
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM