-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm loglevel should be left as default #528
Comments
You could view this is an issue with npm itself giving precedence to the env var as opposed to the explicit file. However, since the multi stage has been added to npm, I'm inclined to think that the settings should probably be added as desired to builder images instead of having on by default for the base image. |
I don't think it's an issue if we stop setting it in this image. I personally just use yarn anyways, and I've never missed more verbose logging there. That said, people expect more verbose stuff on CI where they can't access the logfile if something goes wrong, see e.g. travis-ci/travis-ci#7991
I disagree, it makes sense that |
I had to disable the verbose on my CI because the logs exceed the maximum allowed log of Travis. |
Beside I don't think it's completely unreasonable to require CI to use a slightly customized image. |
I also agree: let's revert back to the npm default |
You don't have to modify the image, just set the |
That's fine, and it's documented in the README: https://github.com/nodejs/docker-node#verbosity But the issue here is why override the npm defaults when users can set I'd prefer if we just reverted to the default npm logging and change the docs to reflect that. I think this issue will keep coming up and I don't think the the rationale for setting the log level to |
@chorrell, @Starefossen commented to me that you even wouldn't need a custom image for CI. |
@Starefossen right, so the question is what value is there in the base image setting the loglevel such that (what seems like) a vast majority of people must then manually override? When it's just as easy for the minority of people to set it to (At my current client, there are hundreds of Jenkins CI config files using this base image container and virtually every single one of them is setting loglevel back to npm's default. That's a clear indication that the image default is wrong if 99% of users need to unset it.) |
npm assumes that you are not running inside a container, it writes all log outputs to the npm-debug.log file which is unaccessible for most when running in a containerized environment, for many having a detailed enough log sent to stdout/stderr is their only means of debugging; especially in a CI environment. @jasonkarns I would kindly ask you to provide us the necessary data for concluding with majority and minority in this case. We are fully aware that a small number of users have asked about the debug level, but the rest of our millions of Node.js Docker users [1] have not weighed in on this discussion. This does not tell us anything about who is the minority and who is the majority in this case though. [1] node is the 11th most downloaded Docker Image on the official Docker Registry: https://hub.docker.com/explore/ |
Indeed. The only two numbers I can gauge on are:
Question: Is this base image supposed to be catering to CIs at the expense of non CI use? Overriding npm's default is jarring and violates principle of least surprise. If it's not suppose to be catering to CI use, then I would kindly suggest that CI users set the env var themselves to their liking (which is trivial in virtually every CI system, as you mentioned). Indeed, my client's use is almost exclusively for CI, and we still prefer npm's default. Underlying this whole discussion is the assumption that If we're focusing this setting for CI users, what are the most common scenarios for failure on CI?
All of these already emit sufficient logging at |
There are a long list of arguments why docker shouldn't be changing npm's default and a lot of vocal support for removing the verbose setting. Now that it's been over a year since this was last discussed, I would like to reopen the discussion to consider returning to npm's default.
warn
already prints (typically) enough info during a failure case. the scenarios whereinfo
is actually necessary to debug a failure are vanishingly slim. indeed, failures themselves are the exception, soinfo
is necessary in a fraction of a fraction of casesnpm config set
because env vars take precedence. thus the only way to get back to npm's default is to set our own env var-the vast majority of people are now forced to manually undo a setting for the tiny percentage that want it to be different than npm's default
And most importantly, contrary to the documented rationale for this setting:
STDOUT
At the very least, this setting should not be set via environment variable, but rather via the builtin config file.
$PREFIX/etc/npmrc
is specifically for distributions to customize defaults to their liking. Using this would allow users to force it back to npm's default using either user or project.npmrc
, instead of forcing users to override using env var or cli flag.The text was updated successfully, but these errors were encountered: