You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
Currently the npm-debug.log is stored in memory, and then dumped to disk when certain problems occur.
Problems
Some errors don't cause a log to be generated, such as:
npm ERR! cb() never called!
npm ERR! not ok code 0
Sometimes npm just hangs and there's no way to know what it was waiting for.
When it fails it only writes out the last 10,000 lines because npmlog has a maxRecordSize of 10000. If it was streaming to disk this wouldn't be an issue. Note: I'm not a consumer of the logs so I'm not sure if the full log is necessary.
Proposed Solutions
Here's some ideas. Any of these might be enough to close this ticket.
Fix the logic causing no long to be written with the above example, and auto-write a log file after some amount of time with no output to stdout to have a debug log for hang events.
Write to the log file immediately (or asynchronously as long as an error won't prevent the last bits from being written.) On success unlink the log file.
Introduce an option to force log file to be written no matter what.