微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Angular 10:TypeError Jimp不是构造函数

如何解决Angular 10:TypeError Jimp不是构造函数

我正在尝试使用此命令:https://github.com/steebchen/text-to-picture

我试图通过自述文件实现示例:

exportInPng(): void {
    textToPicture.convert({
      text: 'LS'
    }).then(result => {
      return result.getBase64()
    }).then(str => {
      console.log(str)
    })
  }
}

在网络浏览器的控制台中,我是这样的:

ERROR Error: Uncaught (in promise): TypeError: Jimp is not a constructor
convert@http://localhost:4200/vendor.js:110960:21
exportInPng@http://localhost:4200/main.js:649:64
ExportComponent_Template_button_click_63_listener@http://localhost:4200/main.js:765:149
executeListenerWithErrorHandling@http://localhost:4200/vendor.js:42712:16
wrapListenerIn_markDirtyAndPreventDefault@http://localhost:4200/vendor.js:42747:54
decoratePreventDefault/<@http://localhost:4200/vendor.js:84974:50
invokeTask@http://localhost:4200/polyfills.js:412:35
onInvokeTask@http://localhost:4200/vendor.js:55433:33
invokeTask@http://localhost:4200/polyfills.js:411:40
runTask@http://localhost:4200/polyfills.js:180:51
invokeTask@http://localhost:4200/polyfills.js:493:38
invokeTask@http://localhost:4200/polyfills.js:1634:18
globalZoneAwareCallback@http://localhost:4200/polyfills.js:1660:31
    Angular 20
    exportInPng export.component.ts:132
    ExportComponent_Template_button_click_63_listener export.component.html:55
    Angular 10

我确实通过npm文本到图片和jimp安装。我做错了什么?

谢谢!

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。