Blog of Raivo Laanemets

Stories about web development, consulting and personal computers.

Make npm 3 play nice with Watch

On 2016-07-04

The npm package manager has a progress bar that sometimes confuses other tools. Many of my recent projects use npm as a build tool. Watch is a periodic execution utility and I have used it with Makefiles to rebuild bundles during development. When I attempted to use it with npm, the output started to drift away, line by line. Debugging took me to npm's GitHub issues list where I found that this could be caused by the progress bar. The bar itself was not visible for me. The bar can be disabled but it is not well documented how to do it.

The solution is linked from this issue and is simply (works only in a recent npm 3 version!):

npm config set progress false

That will disable the progress bar and makes the Watch output not drift away anymore.