问题
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, ifprocess.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:
Check its current setting by running:
npm config get progress
If the aforementioned command returns
false
then set it totrue
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