npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

How do I suppress the version banner from npm output?

OS: Windows 10
Node: 10.13.0
npm: 6.4.1

I run some npm commands during our CI automation and I noticed today that npm sometimes spits out a big annoying banner about upgrading:

> npm config get registry
[redacted]
   ╭───────────────────────────────────────────────────────────────╮
   │                                                               │
   │       New minor version of npm available! 6.4.1 → 6.5.0       │
   │   Changelog: https://github.com/npm/cli/releases/tag/v6.5.0   │
   │               Run npm install -g npm to update!               │
   │                                                               │
   ╰───────────────────────────────────────────────────────────────╯

This messes with automation that is expecting the output of the command to be just the normal output. Is there a command-line flag or config option for suppressing this banner?

Also, I tried doing this myself via head but ran into an issue there too:

$ npm config get registry | head -n 1
[redacted]
npm ERR! code EPIPE
npm ERR! errno EPIPE
npm ERR! syscall write
npm ERR! EPIPE: broken pipe, write

Why is this happening? This doesn’t happen with yarn or any other tool we use.


You can use --update-notifier=false or --no-update-notifier, or use that option in a .npmrc or a environment variable.