I set NPM_FLAGS to --only=prod --verbose from UI, but when building, i’ve got following warning:
2:48:54 PM: npm WARN invalid config only="prod --verbose" set in command line options
2:48:54 PM: npm WARN invalid config Must be one of: null, dev, development, prod, production
This is the line in our build scripts when we use them:
I didn’t go to deep into why that is happening since I discovered that --verbose --only=prod (no explicit quotes in my settings, just for clarity here!) seemed to work better for me - could you let me know if that works better for you too?
Hey @el7cosmos, this seems like a bug to me. When I set NPM_FLAGS to either --verbose or --only=prod seems to work, but setting the variable to both doesn’t seem to work. I’ve opened an issue here (NPM_FLAGS doesn't handle more than one flag · Issue #496 · netlify/build-image · GitHub) and we can let you know if/when there’s movement on it. Or if this is urgent for you, I’m sure the build team would love a PR!
For anyone following this post, just wanted to let you know that thanks to an awesome contribution to our OSS build-image repo, this issue has been fixed and rolled out to our xenial and focal releases.