Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 800
Christopher Walters Avatar asked Sep 13 '25 14:09

Christopher Walters


1 Answers

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.

like image 170
Christopher Walters Avatar answered Sep 15 '25 03:09

Christopher Walters