How to suppress output when running npm scripts

后端 未结 5 510
日久生厌
日久生厌 2020-12-23 10:48

I have decided to experiment with npm scripts as a build tool and so far I like it. One issue I\'d like to solve is when running a script to run jshint when something doesn

5条回答
  •  没有蜡笔的小新
    2020-12-23 11:26

    You should be able to use both the --quiet and --silent options, as in

    npm install --quiet
    

    --quiet will show stderr and warnings, --silent should suppress nearly everything

    You can also send stdout/stderr to /dev/null, like so:

    npm install > "/dev/null" 2>&1
    

    or less versbose

    npm install &> /dev/null
    

提交回复
热议问题