How to suppress npm WARN deprecated messages in bash

You can suppress or quieten NPM via an environment variable:

npm_config_loglevel=silent npm version

This should work in your .bashrc (or wherever you invoke nvm):

npm_config_loglevel=silent nvm use 0.10

Or you can set the environment variable globally

export npm_config_loglevel=silent

Different loglevels can be found here - they are:

"silent", "error", "warn", "http", "info", "verbose", "silly"


You can also add .npmrc file in your project, user directory or globally. The four relevant files are:

  • per-project config file (/path/to/my/project/.npmrc)
  • per-user config file (~/.npmrc)
  • global config file ($PREFIX/etc/npmrc)
  • npm builtin config file (/path/to/npm/npmrc)

Example:

prefix=~/.npm-global
loglevel=error

More information here