Skip to content

fix: unique filename for temporary script files #92

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

Closed
wants to merge 0 commits into from
Closed

fix: unique filename for temporary script files #92

wants to merge 0 commits into from

Conversation

jlarmstrongiv
Copy link
Contributor

Use unique filenames for temporary script files to avoid npm throwing text file busy errors

Switch from Date.now() to crypto.randomBytes(4).toString('hex')

References

Fixes #91
Closes #91

Code References

const fileName = escape.filename(`${event}-${Date.now()}`)

https://github.com/npm/cli/blob/9d6f3f9c410753bf9412ddfeac6a000feccd14f0/lib/npm.js#L447-L448

@jlarmstrongiv jlarmstrongiv requested a review from a team as a code owner July 8, 2022 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] BREAKING REGRESSION npm concurrency regression in 4.1.0 and onwards
2 participants