Gatsby: "Inappropriate ioctl for device" on gatsby serve

Created on 25 Apr 2018  ·  5Comments  ·  Source: gatsbyjs/gatsby

Description

Gatsby fails out of the box following the instructions here: https://www.gatsbyjs.org/docs/

Steps to reproduce

npm install --global gatsby-cli
gatsby new gatsby-site
cd gatsby-site
gatsby build
gatsby serve

Expected result

site should be accessible at http://localhost:9000

Actual result

gatsby serve generates the following error and site is not accessible at http://localhost:9000:

{ Error: Command failed: xsel --clipboard --input
xsel: Can't open display: (null)
: Inappropriate ioctl for device


    at Promise.all.then.arr (/home/hansifer/sites/blog/node_modules/clipboardy/node_modules/execa/index.js:236:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:182:7)
  code: 1,
  killed: false,
  stdout: '',
  stderr: 'xsel: Can\'t open display: (null)\n: Inappropriate ioctl for device\n',
  failed: true,
  signal: null,
  cmd: 'xsel --clipboard --input',
  timedOut: false }

Environment

  • Gatsby version (npm list gatsby): 1.9.250
  • gatsby-cli version (gatsby --version): 1.1.50
  • Node.js version: v9.11.1
  • Operating System: Ubuntu 16

File contents (if changed):

gatsby-config.js: not changed
package.json: not changed
gatsby-node.js: not changed
gatsby-browser.js: not changed
gatsby-ssr.js: not changed

help wanted bug

Most helpful comment

I think that it's a Serve problem because I'm getting the same error when trying to run serve -s build in a Create React App project.
I'm using Node 10.0.0 and Ubuntu 16

All 5 comments

gatsby serve is a small wrapper around serve.

Can you replicate this issue using just serve?

This should do it:

node_modules/.bin/serve -p 9000 ./public

Does that give the same error?

You could also try installing a newer version of serve to see if that does the same thing. Gatsby is on ^6.4.0 at the moment, and the latest is 6.5.6.

Hi, thanks for responding.

Yes, I get the same error when running serve directly.

node_modules/serve/package.json shows version 6.5.6

also: when I do npm list gatsby to get the version I get:

[email protected] /home/hansifer/sites/gatsby-site
└── UNMET DEPENDENCY [email protected]

npm ERR! missing: [email protected], required by [email protected]

also, I have since upgraded gatsby-cli to v1.1.51

I think that it's a Serve problem because I'm getting the same error when trying to run serve -s build in a Create React App project.
I'm using Node 10.0.0 and Ubuntu 16

Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help!

Was this page helpful?
0 / 5 - 0 ratings