How to resolve clipboard error while deploying vuejs app on ubuntu server

Viewed 1541

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.

I have followed these cammands so far.

First installed vue cli using npm install -g @vue/cli

Then created a hello world app using vue create helloWorld

Now run serve command 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

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--debugto 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.

enter image description here

1 Answers

As you can see, there is an X11 dependency with the serve module - which means you need an xserver(display) for it to work.

Alternatively, (highly recommended) you could use a high performance HTTP server like nginx, apache etc. instead.

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! you're up and running.

Cheers!

Related