如何解决运行 npm 脚本时如何禁用标准输出中的纱线错误日志
我在 package.json 中有一个运行测试的 npm 脚本:
foreach(\Yii::$app->log->targets as $target){
$target->setEnabled(false);
}
我用 "scripts": {
"test": "tsc && node ./bin/test"
}
运行它。我从yarn得到编译错误的输出和这个日志:
yarn test
有没有办法删除这个日志,因为它覆盖了屏幕,我看不到编译器错误。
解决方法
yarn -s test
此命令应使日志静默,因为纱线中的 -s
选项表示,
-s,--silent skip Yarn console logs,other types of logs (script output) will be printed
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。