nandorojo / solito

🧍‍♂️ React Native + Next.js, unified.
https://solito.dev
MIT License
3.54k stars 181 forks source link

Stream Error in Node 18 #205

Closed pmn4 closed 2 years ago

pmn4 commented 2 years ago

Getting an error when trying to install with node 18

$ npx create-solito-app@latest path/

blank template selected.

[solito] Failed to download example

 Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
    at new NodeError (node:internal/errors:393:5)
    at Unpack.<anonymous> (node:internal/streams/pipeline:352:14)
    at Unpack.emit (node:events:525:35)
    at [maybeClose] (~/.npm/_npx/a2e881e9997dfd2a/node_modules/create-solito-app/dist/index.js:22:79239)
    at Unpack.e.ondone (~/.npm/_npx/a2e881e9997dfd2a/node_modules/create-solito-app/dist/index.js:22:77780)
    at Unpack.emit (node:events:513:28)
    at [emit] (~/.npm/_npx/a2e881e9997dfd2a/node_modules/create-solito-app/dist/index.js:22:67104)
    at [maybeEnd] (~/.npm/_npx/a2e881e9997dfd2a/node_modules/create-solito-app/dist/index.js:22:68751)
    at [consumeChunk] (~/.npm/_npx/a2e881e9997dfd2a/node_modules/create-solito-app/dist/index.js:22:68815)
    at Unzip.<anonymous> (~/.npm/_npx/a2e881e9997dfd2a/node_modules/create-solito-app/dist/index.js:22:68138) {
  code: 'ERR_STREAM_PREMATURE_CLOSE'
}

fwiw, I used node 14 and it worked just fine

timbielawski commented 2 years ago

The issue here is with tar lib - in unpack.js

Should be fixed in next version

[MAYBECLOSE] () { if (this[ENDED] && this[PENDING] === 0) { this.emit('prefinish') this.emit('finish') this.emit('end') this.emit('close') } }

should be

[MAYBECLOSE] () { if (this[ENDED] && this[PENDING] === 0) { this.emit('prefinish') this.emit('finish') this.emit('end') } }

nandorojo commented 2 years ago

i’ll look into it

nandorojo commented 2 years ago

i would accept a PR to fix this

nandorojo commented 2 years ago

I believe #223 fixes this

nandorojo commented 2 years ago

Fixed for node 18 https://github.com/nandorojo/solito/commit/10fa718aa54e5860dc02280c14389d29321629c4

npx create-solito-app@latest