Error: process.stdout.clearLine()
IhsanDevs opened this issue · 1 comments
IhsanDevs commented
Getting this error when building app from Symfony Proccess :
/opt/homebrew/lib/node_modules/androidjs-builder/modules/Html/ProgressBar.js:35
process.stdout.clearLine();
^
TypeError: process.stdout.clearLine is not a function
at LoadingBar.clear (/opt/homebrew/lib/node_modules/androidjs-builder/modules/Html/ProgressBar.js:35:24)
at LoadingBar.next (/opt/homebrew/lib/node_modules/androidjs-builder/modules/Html/ProgressBar.js:23:14)
at Timeout._onTimeout (/opt/homebrew/lib/node_modules/androidjs-builder/modules/Html/ProgressBar.js:42:18)
at listOnTimeout (node:internal/timers:564:17)
at process.processTimers (node:internal/timers:507:7)
Node.js v18.10.0
I want to building app using my Laravel custom command and will execute a command for building app using Symfony Proccess. This is my PHP Laravel code :
<?php
// ...
public function handle()
{
// run command
$build = new Process(['androidjs','build','--release','-f'], base_path('androidjs-app'));
$build->run(function ($type, $buffer) {
if (Process::ERR === $type) {
echo 'ERR > '.$buffer;
} else {
echo $buffer;
}
});
return Command::SUCCESS;
}
How to fix this problem?
Desktop:
- OS: MacOS Monterey 12.6
m0n4 commented
quick fix:
locate install folder for androidjs-builder with npm list -g
usually: /usr/local/lib/node_modules or /usr/lib/node_modules
in your case: /opt/homebrew/lib/node_modules
cd into it and remove offending lines:
sudo find androidjs-builder -type f -exec sed -i -e "s/process.stdout.clearLine();//g" {} \;
sudo find androidjs-builder -type f -exec sed -i -e "s/process.stdout.cursorTo(0);//g" {} \;
to remove the progess bar too:
sudo find androidjs-builder -type f -exec sed -i -e "s/state.progress.start();//g" {} \;
sudo find androidjs-builder -type f -exec sed -i -e "s/progress.start();//g" {} \;