No progress feedback from NPM commands in Git Bash on Windows

佐手、 提交于 2020-03-22 08:57:32

问题


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.


回答1:


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

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.

Perhaps it has inadvertently been set to false.

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

  1. Check its current setting by running:

    npm config get progress
    
  2. If the aforementioned command returns false then set it to true by running:

    npm config set progress true
    

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

it returned:

undefined

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

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



来源:https://stackoverflow.com/questions/59586270/no-progress-feedback-from-npm-commands-in-git-bash-on-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!