Search code examples
node.jsnpmconfig

npm Warning: config production; Use --omit=dev Instead


Every time I run any kind of npm command, I get the following error before the actual output:

npm WARN config production Use `--omit=dev` instead.

Of course I've come across similar issues regarding the -g flag, and I updated npm to avoid that problem. Some of the workarounds describe editing the npm and npm.cmd in the program files for node to remove these flags, but for this error in particular, the word production occurs nowhere in those configuration files. Unhelpfully, npm's warnings don't include a reference to the file that contains this irksome configuration setting.

Can anyone offer advice on where to search for this configuration, or at least how to silence this redundant warning message?


Solution

  • And of course, as soon as I ask, I find an answer somewhere else:

    I created an error log because of a different npm crash, and when I search the log, I found the config file that was causing the error:

    C:\Users\Chris\AppData\Roaming\npm\etc\npmrc
    

    Sure enough, I open the file, find production=false, delete the necessary line, and now the error has disappeared.