-
-
Notifications
You must be signed in to change notification settings - Fork 944
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
pnpm audit process exits before flushing stdout #3526
Comments
Good investigation! Probably we can do this change |
should we define a specific Error for process exit, and have extra logic in packages/pnpm/src/pnpm.ts |
I think all the exit calls happen in this file https://github.com/pnpm/pnpm/blob/main/packages/pnpm/src/main.ts |
I was think all internal exit should be replaced with throw error and being handled in pnpm.ts/pnpx.ts since they already have error handling logics. pnpm/packages/pnpm/src/pnpm.ts Lines 70 to 78 in 918d23d
|
No, that is not a good idea because some commands don't print an error just exit with a 1 exit code. |
I made a PR just fixing exit in |
pnpm version: 6.7.4
Code to reproduce the issue:
Expected behavior:
The output of the child process running
pnpm audit
is available.Actual behavior:
The output of the child process is truncated (if the output is greater than 8192 bytes).
Additional information:
This problem only seems to occur on MacOS. I believe it's because the pnpm CLI calls
process.exit()
prior to stdout being fully flushed. See output truncated at 8192 bytes below:node -v
prints: v15.11.0Here's an example of how someone else resolved using
process.exitCode = 1
rather thanprocess.exit(1)
.The text was updated successfully, but these errors were encountered: