node.js - 使用 execa 或 pkg-install run 'yarn install dependencies' 时如何输出安装日志
问题描述
我写了一个cli来初始化我的项目。下面是核心代码
import execa from 'execa'
import Listr from 'listr'
import { projectInstall } from 'pkg-install'
...
const tasks = new Listr([
{
title: `Initialize project ${options.projectPath}`,
task: () => gitClone(options)
},
{
title: 'Install dependencies',
task: () =>
projectInstall({
prefer: 'yarn',
cwd: options.targetDirectory
})
}
])
但是在终端看不到yarn install log。只能看到任务标题,等了几分钟,怎么才能正常输出yarn install log的进度条
解决方案
推荐阅读
- c++ - 如何使用 C++17 的文件系统检查路径是否引用 Windows 中的卷?
- python - Python:加载txt文件并形成数据框
- node.js - 实体管理器和存储库 typeorm 之间的区别
- javascript - 我将如何用 Jquery 或 javascript 重新编写这个 css?
- html - 使前 2 个标题变粘
- javascript - Vue.js 组件仅在浏览器页面刷新后更新
- ios - “使用 Bitcode 重建”和可选依赖项
- elasticsearch - 将 url 标记为已死。最后一个错误:HostUnreachableError
- concurrency - 我收到“来自 NNN-USD 的未定义汇率”
- c# - 在生产环境中使用 Fluent Asserts 增强默认的 .NET LINQ 不良异常?