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
--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.
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!
I had the same issue and I solved it by adding "-n" option to serve.
"-n, --no-clipboard Do not copy the local address to the clipboard"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.