Im my node + typescript application I have the following code.
const base64Data = new Buffer.from(url, 'base64');
Here it gives the following error.
'new' expression, whose target lacks a construct signature, implicitly has an 'any' type.
I have installed @types/node. Why am I getting this error? How can I fix this?
You can fix it by either using
Buffer.from(url, 'base64');
or
new (Buffer.from as any)(url, 'base64');
But, I don't know why this is an issue if you have types installed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With