I tried to use Sharp image processing in my create react app. But it sends an error
This is my code:
import sharp from 'sharp';
const buffer = await sharp(req.file.buffer)
.resize({ width: 250, height: 250 })
.extend({
top: 10,
bottom: 10,
left: 10,
right: 10,
background: '#d7d8de'
})
.png()
Edit: I’m using Node.js version 12.18.0