berry: [Bug?]: node17 compat: │ Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
Self-service
- I’d be willing to implement a fix
Describe the bug
Fetch step ➤ YN0001: │ Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close at new NodeError (node:internal/errors:371:5) at PassThrough.onclose (node:internal/streams/end-of-stream:122:30) at PassThrough.emit (node:events:390:28) at emitCloseNT (node:internal/streams/destroy:145:10) at processTicksAndRejections (node:internal/process/task_queues:82:21)
To reproduce
https://github.com/weiran-zsd/dts-cli/runs/3947685268
Environment
os: ubuntu-latest
Node.js: v17.0.0
yarn: v3.0.2
Additional context
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 24
- Comments: 15 (1 by maintainers)
Commits related to this issue
- ci(circleci): fix Node versions to 16 (LTS), rather than 17 This avoids the following Yarn / Node 17 regression: [Bug?]: node17 compat: │ Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close #3597 <... — committed to registreerocks/registree-core by PiDelport 3 years ago
- ci: use Node 16 LTS for CirceCI, and Yarn 2 updates (#402) * ci(circleci): fix Node versions to 16 (LTS), rather than 17 This avoids the following Yarn / Node 17 regression: [Bug?]: node17 comp... — committed to registreerocks/registree-core by PiDelport 3 years ago
- Fix Yarn and upgrade from 3.0.2 to 3.1.0 (set version berry) Resolve both issues from OP and comment https://github.com/yarnpkg/berry/issues/3597#issuecomment-968065741 yarn-berry.cjs name looks de... — committed to leotm/react-native-template-new-architecture by leotm 3 years ago
- Upgrade Yarn from 3.1.0 to 3.2.0-rc.3 (set version from sources) Follow-up on https://github.com/yarnpkg/berry/issues/3597#issuecomment-968065741 / 6b81235d No yarn.lock change noted this on from fo... — committed to leotm/react-native-template-new-architecture by leotm 3 years ago
- Upgrade Yarn to fix support for Node 17 https://github.com/yarnpkg/berry/issues/3597 — committed to davidjb/cv by davidjb 2 years ago
- yarn set version berry (3.0 -> > 3.1) to fix ERR_STREAM_PREMATURE_CLOSE See also: https://github.com/yarnpkg/berry/issues/3597 — committed to tony/cv by tony 2 years ago
- Move to yarn berry See also: https://yarnpkg.com/getting-started/migration Squashed: yarn set version berry (3.0 -> 3.1+) to fix ERR_STREAM_PREMATURE_CLOSE In our case this bumped to 3.2.3 See al... — committed to tony/cv by tony 3 years ago
- Move to yarn berry See also: https://yarnpkg.com/getting-started/migration Squashed: yarn set version berry (3.0 -> 3.1+) to fix ERR_STREAM_PREMATURE_CLOSE In our case this bumped to 3.2.3 See al... — committed to tony/cv by tony 3 years ago
- Move to yarn berry See also: https://yarnpkg.com/getting-started/migration Squashed: yarn set version berry (3.0 -> 3.1+) to fix ERR_STREAM_PREMATURE_CLOSE In our case this bumped to 3.2.3 See al... — committed to tony/cv by tony 3 years ago
- * upgrade yarn from 3.0.1 to 3.2.3 in order to compatible with node 17+: https://github.com/yarnpkg/berry/issues/3597 — committed to n0099/res by n0099 2 years ago
- * upgrade yarn from 3.0.1 to 3.2.3 in order to compatible with node 17+: https://github.com/yarnpkg/berry/issues/3597 — committed to n0099/res by n0099 2 years ago
- Upgrade Yarn to 3.2.4 This fixes an issue I had locally when running `yarn`: ``` ➤ YN0001: │ Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close at new NodeError (node:internal/errors:387:5) ... — committed to Mojang/ore-ui by pirelenito 2 years ago
- Upgrade Yarn to 3.2.4 (#98) This fixes an issue I had locally when running `yarn`: ``` ➤ YN0001: │ Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close at new NodeError (node:internal/errors:... — committed to Mojang/ore-ui by pirelenito 2 years ago
- Move to yarn berry See also: https://yarnpkg.com/getting-started/migration Squashed: yarn set version berry (3.0 -> 3.1+) to fix ERR_STREAM_PREMATURE_CLOSE In our case this bumped to 3.2.3 See al... — committed to tony/cv by tony 3 years ago
- build(deps): upgrade from Yarn Berry (v2.x) to v3.3.0 The issue that this fixes is that on NodeJS v18.x LTS Yarn started crashing with the following error on the CI while trying to install the depend... — committed to petermetz/dci-lint by petermetz 2 years ago
- Move to yarn berry See also: https://yarnpkg.com/getting-started/migration Squashed: yarn set version berry (3.0 -> 3.1+) to fix ERR_STREAM_PREMATURE_CLOSE In our case this bumped to 3.2.3 See al... — committed to tony/cv by tony 3 years ago
- Move to yarn berry See also: https://yarnpkg.com/getting-started/migration Squashed: yarn set version berry (3.0 -> 3.1+) to fix ERR_STREAM_PREMATURE_CLOSE In our case this bumped to 3.2.3 See al... — committed to tony/cv by tony 3 years ago
- Move to yarn berry See also: https://yarnpkg.com/getting-started/migration Squashed: yarn set version berry (3.0 -> 3.1+) to fix ERR_STREAM_PREMATURE_CLOSE In our case this bumped to 3.2.3 See al... — committed to tony/cv by tony 3 years ago
- yarn: classic -> 4.0.2 (yarn set version 4.0.2) yarn set version 4.0.2 See also: - https://yarnpkg.com/getting-started/migration - https://yarnpkg.com/blog/release/4.0#installing-yarn Squashed: ya... — committed to tony/cv by tony 3 years ago
- yarn: classic -> 4.0.2 (yarn set version 4.0.2) yarn set version 4.0.2 See also: - https://yarnpkg.com/getting-started/migration - https://yarnpkg.com/blog/release/4.0#installing-yarn Squashed: ya... — committed to tony/cv by tony 3 years ago
yarn set version latest
.node:latest
=>node:lts
).Following command solved the issue in my environment:
yarn set version latest
@aladdin-add , Thank you! ❤️
yarn set version berry
and upgraded tov3.1.0
, it DOES solved the problem! 🎉since this issue describes the problem i had pretty well, but i didn’t find my solution here, i think i’ll share what made it work in my case (trying to get govuk-react running on my computer):
after running
yarn set version latest
(which upgraded the local yarn installation to 3.2.4), i also had theCannot redefine settings "changesetBaseRefs"
error when runningyarn
.so, i ended up deleting the
.yarn/plugins/@yarnpkg
folder and deleting entries from theplugins
section in.yarnrc.yml
, which looked like this beforei then ran these commands to reinstall the plugins:
since i’m not used to yarn, i don’t know how usually to go about this issue, but the described worked for me. no more errors when running
yarn
!For folks showing up here from Google… in modern times
yarn set version stable
might be better for you. This will force major upgrades (which could be good or bad) but will often get you around other issues.Updating yarn to latest leads me to a new error:
Any clue on how I can go about fixing it?
You need to update the plugins you’re using as well
I’m getting the same issue. Feels like I’m going in circles 😅 .
Thanks for posting this issue, helped me figure out why I suddenly started seeing
ERR_STREAM_PREMATURE_CLOSE
errors in CI. It turned out I had an issue with my Dockerfile as I had written:Which I guess suddenly starting pulling the Node v17 image today. I should have written:
(or something like this)