LoginSignup
0
0

GitHub Actions上でのprocess.stdout.clearLine is not a function

Last updated at Posted at 2024-02-06

ローカル開発では問題なく使えていたprocess.stdout.なんとかがGitHub Actions上だと使えなかったです。

process.stdout.clearLine();
                           ^

TypeError: process.stdout.clearLine is not a function

GitHub Actionsではprocess.stdout系は使えない模様。

issueあげてる人もいるようにprocess.stdout系は使えない模様。

またprocess.stdout.writeだけは使えるようです。

GPTもこんな回答を

スクリーンショット 2024-02-06 19.44.26.png

process.stdout.isTTYで判断

ターミナルが対応してるかどうかを調べつつ判断するのが良さそうです。

if (process.stdout.isTTY) {
	//ローカル開発
    process.stdout.clearLine();
    process.stdout.cursorTo(0);
    process.stdout.write(`Downloaded ${Math.round(progress / 10000) / 100} MB`);
}else{
	//GitHub Actions上
    process.stdout.write('.');
}

GitHub Actions上でのデバッグようツール

こんなのもあるみたいでした

プログレス表示がしたかったので使えそうなのがあまりないかも...? (試せて無い)

0
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
0
0