-
Notifications
You must be signed in to change notification settings - Fork 3.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
[QUESTION] How to disable creating of verbose log files for every npm command? #4206
Comments
we create a log file for every command we run to ensure we don't lose any context if an error does occur. this is not configurable. the if we were to disable this feature, we would have no means of providing a complete debug log when a command fails. we can't only create them when there's an error, because we don't know whether or not there's going to be an error when the log initially begins writing. our options are either to buffer the log messages in memory, which is unwise since debug logs can be rather large, or stream them to a file. we chose the latter. this also allows us to still get some debug log output if an unexpected crash occurs. older versions of npm buffer log messages in memory and write the file only when an error takes places, we had many scenarios that were difficult to debug due to the loss of context when failures happened before the log file could be written fully. for what it's worth, the old log files should be removed the next time you run a command. if that's not happening, that would be a bug and we can look into it. |
@nlf - Thanks for clarifying this one. I can confirm that the old verbose log files are not being deleted. |
The debug log can now be disabled with the config |
I found out that adding |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When I run any npm related command I got a new debug log file created, which is kinda annoying.
How can prevent the debug log files being created after each npm command?
Form example when I run
npm -v
, I got a new log file with the following output:When I start some node app with
npm run dev
(for example, some Nuxt.js app), again I got a new log file:And so on - I got a new log file for every command, not only for errors or warnings.
My global
.npmrc
file has no extra settings.Even if I add to it `loglevel=silent' I still have the new log files, but the info in the terminal is being cut off.
Any ideas to prevent these verbose log files being created and keep them only for errors and warning?
Expected Behavior
Not to have a verbose log file for each npm command.
Steps To Reproduce
No response
Environment
npm config ls
:npm config ls -l
:The text was updated successfully, but these errors were encountered: