Closed aladdin-add closed 2 years ago
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:
FROM node:alpine AS builder
Which I guess suddenly starting pulling the Node v17 image today. I should have written:
FROM node:lts-alpine AS builder
(or something like this)
@patdx & @aladdin-add , I'm currently facing the same problem.
Should I downgrade my Node.js to LTS v16.x
version? Thank you! ❤️
Error logs are as follows:
(base) Study-Notes on main ● λ yarn add -D vuepress-theme-vdoing
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @vue/babel-plugin-jsx@npm:1.0.7 doesn't provide @babel/core (pa6c52), requested by @babel/plugin-syntax-jsx
➤ YN0002: │ @vuepress/core@npm:1.8.2 doesn't provide @vue/compiler-sfc (p4c8a9), requested by vue-loader
➤ YN0002: │ study-notes@workspace:. doesn't provide chalk (p75ef5), requested by vuepress-plugin-sitemap
➤ YN0002: │ study-notes@workspace:. doesn't provide commander (p17913), requested by vuepress-plugin-sitemap
➤ YN0002: │ study-notes@workspace:. doesn't provide esm (p844b2), requested by vuepress-plugin-sitemap
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 873ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ @better-scroll/core@npm:2.4.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ @better-scroll/shared-utils@npm:2.4.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ @better-scroll/slide@npm:2.4.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ good-storage@npm:1.1.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ vuepress-theme-vdoing@npm:1.8.5 can't be found in the cache and will be fetched from the remote registry
➤ 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)
➤ YN0000: └ Completed in 0s 726ms
➤ YN0000: Failed with errors in 1s 603ms
yarn add -D vuepress-theme-vdoing
I invoked yarn add -D vuepress-theme-vdoing
several times, it first failed with Y0001
error but suddenly "fixed" itself and installed the dependency successfully (only with some unimportant warnings). Can't reproduce it again.
(base) Study-Notes on main ● λ yarn add -D vuepress-theme-vdoing
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @vue/babel-plugin-jsx@npm:1.0.7 doesn't provide @babel/core (pa6c52), requested by @babel/plugin-syntax-jsx
➤ YN0002: │ @vuepress/core@npm:1.8.2 doesn't provide @vue/compiler-sfc (p4c8a9), requested by vue-loader
➤ YN0002: │ study-notes@workspace:. doesn't provide chalk (p75ef5), requested by vuepress-plugin-sitemap
➤ YN0002: │ study-notes@workspace:. doesn't provide commander (p17913), requested by vuepress-plugin-sitemap
➤ YN0002: │ study-notes@workspace:. doesn't provide esm (p844b2), requested by vuepress-plugin-sitemap
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 497ms
➤ YN0000: ┌ Link step
➤ YN0076: │ fsevents@patch:fsevents@npm%3A1.2.13#~builtin<compat/fsevents>::version=1.2.13&hash=18f3a7 The win32-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ fsevents@patch:fsevents@npm%3A2.3.2#~builtin<compat/fsevents>::version=2.3.2&hash=18f3a7 The win32-x64 architecture is incompatible with this module, link skipped.
➤ YN0000: └ Completed in 0s 777ms
➤ YN0000: Done with warnings in 1s 562ms
yarn set version latest
.node:latest
=> node:lts
).@aladdin-add , Thank you! ❤️
yarn set version berry
and upgraded to v3.1.0
, it DOES solved the problem! 🎉@aladdin-add M V P ❤️
on a side-note, also my hero back in ole '96
yarn set version from sources
also works (v3.2.0-rc.3)
and gets me past TypeError: e is not iterable
in yarn-berry.cjs locally
and fixes CI failing to upgrade to v3.1.0
Following command solved the issue in my environment:
yarn set version latest
I had this issue trying to yard add stripe
. Error was YN0001: │ Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
.
@bmaier 's yarn set version latest
took my yarn to 3.1.1
which allowed me to successfully run yarn add stripe
.
Updating yarn to latest leads me to a new error:
Internal Error: Cannot redefine settings "changesetBaseRefs"
at Xa.importSettings (/Users/harshgupta/code/instant-apps/.yarn/releases/yarn-3.2.0.cjs:395:24057)
at Xa.activatePlugin (/Users/harshgupta/code/instant-apps/.yarn/releases/yarn-3.2.0.cjs:395:23932)
at Function.find (/Users/harshgupta/code/instant-apps/.yarn/releases/yarn-3.2.0.cjs:395:22198)
at async i (/Users/harshgupta/code/instant-apps/.yarn/releases/yarn-3.2.0.cjs:448:11309)
at async r (/Users/harshgupta/code/instant-apps/.yarn/releases/yarn-3.2.0.cjs:448:10887)
Any clue on how I can go about fixing it?
Updating yarn to latest leads me to a new error:
Internal Error: Cannot redefine settings "changesetBaseRefs" at Xa.importSettings (/Users/harshgupta/code/instant-apps/.yarn/releases/yarn-3.2.0.cjs:395:24057) at Xa.activatePlugin (/Users/harshgupta/code/instant-apps/.yarn/releases/yarn-3.2.0.cjs:395:23932) at Function.find (/Users/harshgupta/code/instant-apps/.yarn/releases/yarn-3.2.0.cjs:395:22198) at async i (/Users/harshgupta/code/instant-apps/.yarn/releases/yarn-3.2.0.cjs:448:11309) at async r (/Users/harshgupta/code/instant-apps/.yarn/releases/yarn-3.2.0.cjs:448:10887)
Any clue on how I can go about fixing it?
I'm getting the same issue. Feels like I'm going in circles 😅 .
You need to update the plugins you're using as well
Is there any sort of comprehensive document on how to upgrade from yarn@2.x.x
to yarn@3.x.x
?
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 the Cannot redefine settings "changesetBaseRefs"
error when running yarn
.
so, i ended up deleting the .yarn/plugins/@yarnpkg
folder and deleting entries from the plugins
section in .yarnrc.yml
, which looked like this before
plugins:
- - path: .yarn/plugins/@yarnpkg/plugin-version.cjs
- spec: "@yarnpkg/plugin-version"
- - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
- spec: "@yarnpkg/plugin-workspace-tools"
- - path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
- spec: "@yarnpkg/plugin-typescript"
i then ran these commands to reinstall the plugins:
yarn plugin import @yarnpkg/plugin-version
yarn plugin import @yarnpkg/plugin-workspace-tools
yarn plugin import @yarnpkg/plugin-typescript
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.
Setting YARN_CHECKSUM_BEHAVIOR=update
in the environment is the only thing that worked for me.
That is, either doing export YARN_CHECKSUM_BEHAVIOR=update
or else running YARN_CHECKSUM_BEHAVIOR=update yarn
as the command, instead of just yarn
.
(from https://stackoverflow.com/a/71276936/441757, via https://github.com/substrate-developer-hub/substrate-front-end-template/issues/213#issuecomment-1051812768)
docker 6.1.0 same error, S3 BackBlaze
Self-service
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
Additional context
No response