-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug?]: fs.rm
is broken with recursive option in yarn 3 pnp, node >= 20.12.0
#6247
Comments
fs.rm
is broken in yarn 3.8.1, node 20.12.1fs.rm
is broken with recursive option in yarn 3.8.1, node 20.12.1
From Node 20.12.0, ESM facade is build when it's necessary. Before this change (like, <=Node 20.11.1) when the In
|
Looks like that yarn 4 |
fs.rm
is broken with recursive option in yarn 3.8.1, node 20.12.1fs.rm
is broken with recursive option in yarn 3, node > 20.12.0
fs.rm
is broken with recursive option in yarn 3, node > 20.12.0fs.rm
is broken with recursive option in yarn 3, node >= 20.12.0
fs.rm
is broken with recursive option in yarn 3, node >= 20.12.0fs.rm
is broken with recursive option in yarn 3 pnp, node >= 20.12.0
Is there any way to resolve this or is there a later yarn 3 patch that addresses this? I am having the same issue currently after updating node in my project. Am I forced to update to yarn 4? I'd prefer not to but I was curious what my options were. |
Not very helpful, but I just downgraded my node version to 20.11.1. |
Self-service
Describe the bug
When using
fs.rm
withrecursive: true
(or its sync, async versionrmSync
andfs/promises#rm
), there's an error ofTypeError [ERR_INVALID_ARG_TYPE]: The "list[2]" argument must be an instance of Buffer or Uint8Array. Received type string
.To reproduce
yarn node test.js
Environment
Additional context
I found this doesn't happen on node 18.
recursive
option of fs.rm usesreaddirSync
, and on Node 18 we use pure node fs module but on Node 20 we use pnp patched version.This error happens when the patched
readdirSync
is used internally, by converting the result from Buffer to string withNodePathFS.mapToBase
. It also means that pnp patchedreaddirSync
does not respect theencoding
option, which isbuffer
in internal/fs/rimraf. According to Node.js Docs if the encoding option set tobuffer
, the result should be an array of buffer.The text was updated successfully, but these errors were encountered: