LoginSignup
1
0

More than 3 years have passed since last update.

Gatsby 2.24.2 が何故か動かない

Posted at

内容まとめ

gatsby developで以下のエラーが出て動かない

Error: EBADF: bad file descriptor, uv_pipe_open
    at Object._forkChild (child_process.js:122:5)
    at setupChildProcessIpcChannel (internal/bootstrap/pre_execution.js:329:30)
    at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:54:3)
    at internal/main/run_main_module.js:7:1 {
  errno: -4083,
  code: 'EBADF',
  syscall: 'uv_pipe_open'
}

環境

  • win10
  • node 14.4.0
  • npm 6.14.5

gatsby-cliのインストール


$ npm i -g gatsby-cli

バージョンの確認

$ gatsby --version
Gatsby CLI version: 2.12.60

新規サイトの作成

$ gatsby new gatsby-site

ローカルサーバーの立ち上げ

以下のエラーでストップする

$ cd ./gatsby-site
$ gatsby develop

child_process.js:122
  p.open(fd);
    ^

Error: EBADF: bad file descriptor, uv_pipe_open
    at Object._forkChild (child_process.js:122:5)
    at setupChildProcessIpcChannel (internal/bootstrap/pre_execution.js:329:30)
    at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:54:3)
    at internal/main/run_main_module.js:7:1 {
  errno: -4083,
  code: 'EBADF',
  syscall: 'uv_pipe_open'
}

BuildコマンドやServeコマンドは実行可能

$ gatsby build
$ gatsby serve

解決方法

  • 直接の原因が分からなかった
  • 同じPCで動いている別のGatsbyサイトがあった

上記から、ひとまずパッケージのバージョンを合わせることで解決

...
"dependencies": {
    "gatsby": "^2.24.2", -> "^2.20.12"
    "react": "^16.13.1", -> "^16.12.0"
    "react-dom": "^16.13.1" -> "^16.12.0"
},
"devDependencies": {
    "prettier": "2.0.5" -> "2.0.4"
},
...
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0