【发布时间】:2020-06-04 21:55:04
【问题描述】:
我的项目中需要 Tesseract,所以首先我使用了yarn add tesseract.js,然后我使用了yarn add --dev @types/tesseract.js。当我尝试使用 ng serve 时,出现以下错误:
ERROR in node_modules/tesseract.js/src/index.d.ts:98:60 - error TS2591: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
98 | CanvasRenderingContext2D | File | Blob | ImageData | Buffer;
有人知道如何解决这个问题吗?提前致谢
【问题讨论】:
-
面临同样的问题。任何有效的解决方案?