stack-chan / stack-chan

A JavaScript-driven M5Stack-embedded super-kawaii robot.
Apache License 2.0
833 stars 100 forks source link

Ubuntu 22.04で`npm run setup`に失敗する #192

Open meganetaaan opened 1 year ago

meganetaaan commented 1 year ago

不具合の概要

npm run setupに失敗する

再現手順 不具合を再現できる手順を記述してください

  1. npm run setupを実行する
  2. 以下のエラーが発生する
washishi@ubuntu:~/stack-chan/firmware$ npm run setup

> stack-chan@0.2.1 setup
> xs-dev setup

Setting up Linux tools!
? Installing dependencies.../home/washishi/stack-chan/firmware/node_modules/gluegun/build/index.js:15
    throw up;
    ^

Error: Command failed with exit code 1: sudo --askpass --preserve-env apt-get install --yes gcc git wget make libncurses-dev flex bison gperf
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

sudo: no password was provided
    at makeError (/home/washishi/stack-chan/firmware/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/home/washishi/stack-chan/firmware/node_modules/execa/index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  shortMessage: 'Command failed with exit code 1: sudo --askpass --preserve-env apt-get install --yes gcc git wget make libncurses-dev flex bison gperf',
  command: 'sudo --askpass --preserve-env apt-get install --yes gcc git wget make libncurses-dev flex bison gperf',
  escapedCommand: 'sudo --askpass --preserve-env apt-get install --yes gcc git wget make libncurses-dev flex bison gperf',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: 'qt.qpa.xcb: could not connect to display \n' +
    'qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.\n' +
    'This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.\n' +
    '\n' +
    'Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.\n' +
    '\n' +
    'sudo: no password was provided',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

想定する挙動 環境構築が正しく行われる

環境 (次の項目を埋めてください):

その他

Discordで @mongonta0716 さん、 @washishi さんから報告いただきました。

meganetaaan commented 1 year ago

通常xs-devssh-askpassを使ってUI上でのパスワード入力を求めますが、Ubuntu 22.04ではこのパッケージが初期状態でインストールされていないためにエラーが発生します。

$ sudo ls
$ npm run setup