caderek / gramma

command-line grammar checker
https://caderek.github.io/gramma/
ISC License
251 stars 18 forks source link

gramma server install fails #47

Open gtournie opened 1 year ago

gtournie commented 1 year ago

Describe the bug command 'npx gramma server install' fails:

res.body.pipe(str).pipe(fileStream)
             ^
TypeError: res.body.pipe is not a function

To Reproduce install gramma with node 18.16.0 & npm 9.5.1

Expected behavior It should download the file

Screenshots

Capture d’écran 2023-05-29 à 23 33 27

Desktop (please complete the following information):

Additional context Seems to work if I replace this slice of code in downloadFile.js (L30):

 return new Promise((resolve, reject) => {
     res.body.pipe(str).pipe(fileStream)
     res.body.on("error", (err) => {
       reject(err)
     })
    fileStream.on("finish", () => {
      bar.stop()
      resolve()
    })
 })

by

await pipeline(res.body, str, fileStream)
bar.stop()

with const { pipeline } = require('node:stream/promises');

skogsbaer commented 10 months ago

Any progress here? The bug also hurts me