Git Bash Windows 中的 NPM 命令没有进度反馈

No progress feedback from NPM commands in Git Bash on Windows

在我的新机器 (windows 10) 上,当我 运行 NPM 命令如 npm start 时,我没有看到像以前那样多的反馈。

我猜这是我缺少的进度指示器。通常看起来什么都没有发生,没有反馈。

尤其是在安装模块的时候,真的像是挂了东西。最终命令正常完成。

npm 有一个 progress 配置键。说明如下:

progress

  • Default: true, unless TRAVIS or CI env vars set.
  • Type: Boolean

When set to true, npm will display a progress bar during time intensive operations, if process.stderr is a TTY.

Set to false to suppress the progress bar.

可能不小心设置为false

get/set progress配置你可以使用npm-config命令:

  1. 通过 运行ning 检查其当前设置:

    npm config get progress
    
  2. 如果前面提到的命令returns false 那么通过运行ning将其设置为true:

    npm config set progress true
    

注意:git-bash可能被分类为"dumb terminal"

我在 Windows 的早期版本上安装了 git-bash,当我 运行:

npm config get progress

它返回:

undefined

将其设置为 true 没有任何区别,即它没有进度条。

我假设 my terminal (git-bash) is dumb,即不支持进度条。你的也可能是愚蠢的!