Comments (2)
From Node 20.12.0, ESM facade is build when it's necessary. Before this change (like, <=Node 20.11.1) when the fs
module is imported, internal/fs/rimraf
was also resolved.
In .pnp.cjs
of yarn 3.8.1, we do require('fs')
. At this point fs is not patched at all. So this happens:
- If you're using Node.js <20.12.0,
internal/fs/rimraf
is resolved bygetESMFacade
. It uses non-pnp version offs.readdirSync
(original version), which can handleencoding
option. No Error. - If you're using Node.js >=20.12.0,
internal/fs/rimraf
is not resolved. After we meet the code in user script which actually useinternal/fs/rimraf
(e.gfs.rmSync
), node resolves the module. At this point we already done the preloading of pnp patching, sointernal/fs/rimraf
uses pnp-patched version offs.readdirSync
, which doesn't handleencoding
option. Butinternal/fs/rimraf
wants it to return the result as buffer array, so there's an Error.
from berry.
Looks like that yarn 4 NodeFS.readdir(Sync)
supports the options correctly, but not for <3. So this error happens when you use Node.js 20.12.0 or later && yarn 3.x or earlier.
from berry.
Related Issues (20)
- [Bug?][behavior question]: yarn with corepack still requires yarn set version to use the correct version HOT 1
- [Bug?]: Specifying `supportedArchitectures..current` is incompatible with `--immutable-cache`
- [Bug?]: Typescript project throws an error when moving towards `nodeLinker: pnp` HOT 1
- Line numbers are buggy after line 99999 in the package file viewer
- [Bug?]: frozen-lockfiles for file dependencies
- [Bug?]: Yarn doesn't make dependency executables available on PATH for `yarn run`
- [Bug]: The exec protocol does not respect extension HOT 1
- [Feature] audit signatures
- [Bug?]: `fsBinding.cpSyncCheckPaths` error in Node 22 HOT 1
- [Bug?]: Unrecognized or legacy configuration settings found: command - run "yarn config -v" to see the list of settings supported in Yarn (in <environment>) HOT 5
- [Bug]: Cannot use literal `${x}` in environment variable files HOT 3
- [Bug?]: Hoisting issue when a single workspace package has hoistingLimits: workspaces
- [Bug?]: node_modules hoisting issue with inner workspaces
- [Bug?]: After using a symbolic link to move the global cache folder to another partition, "yarn dlx" failed. HOT 1
- [Bug?]: linked project with gives error "is controlled by multiple pnpapi instances" in VSC
- [Bug?]: "docker compose run" with docker cache fails after building ( it can not find yarn installed module in cache folder) HOT 3
- [Bug?]: yarn dlx -p not working with package.json scripts HOT 4
- [Bug?]: Missing package: typescript@patch:typescript@npm HOT 1
- [Bug?]: Can't fetch Gitlab dependencies via SSH HOT 1
- [Bug?]: yarn requires npmAuthToken even when not doing anything registry-related HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from berry.