Windows上的Git Bash中NPM命令没有进度反馈 [英] No progress feedback from NPM commands in Git Bash on Windows

查看:442
本文介绍了Windows上的Git Bash中NPM命令没有进度反馈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的新计算机(Windows 10)上,当我运行诸如npm start之类的NPM命令时,没有像以前那样多的反馈了.

On my new machine (windows 10) when I run NPM commands like npm start I don't see as much feedback as I used to.

我想这是我缺少的进度指示器.经常似乎什么也没有发生,没有反馈.

I guess it is the progress indicator I am missing. It often appears that nothing is happening, no feedback.

特别是在安装模块时,看起来好像已经挂了东西.最终,命令正常完成.

Especially when installing modules, it really looks like the thing has hung. Eventually the command completes as normal.

推荐答案

npm具有 配置密钥.描述如下:

npm has a progress configuration key. It is described as follows:

进度

  • 默认:true,除非设置了TRAVIS或CI env vars.
  • 类型:布尔值

设置为true时,如果process.stderr是TTY,则npm将在耗时的操作中显示进度条.

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

设置为false以取消进度条.

可能是无意中将其设置为false.

Perhaps it has inadvertently been set to false.

对于get/set progress配置,您可以使用 npm-config 命令:

To get/set the progress configuration you can utilize the npm-config command:

  1. 通过运行以下命令检查其当前设置:

  1. Check its current setting by running:

npm config get progress

  • 如果上述命令返回false,则通过运行将其设置为true:

  • If the aforementioned command returns false then set it to true by running:

    npm config set progress true
    


  • 注意:git-bash可以归类为哑终端"

    我在早期版本的Windows上以及运行时安装了git-bash:


    Note: git-bash may be classified as a "dumb terminal"

    I have git-bash installed on an earlier version of Windows and when I run:

    npm config get progress
    

    它返回:

    undefined

    将其设置为true没什么区别,即没有进度条.

    Setting it to true made no difference, i.e. it does not get a progress bar.

    我假设我的终端(git-bash)是哑巴,即进度不支持bar.你的也可能很蠢!

    I assume my terminal (git-bash) is dumb, i.e. a progress bar is not supported. Yours may be dumb too !

    这篇关于Windows上的Git Bash中NPM命令没有进度反馈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆