简体   繁体   English

Angular 2+中的Maker.js集成

[英]Maker.js integration in Angular 2+

I would like to integrate Maker.js in an Angular Projekt. 我想将Maker.js集成到Angular项目中。 I installed it via npm: 我通过npm安装了它:

npm install makerjs --save
npm install --save @types/maker.js

When I try to run the application I get an Error : 当我尝试运行该应用程序时,出现错误消息

[…]/node_modules/makerjs/index.d.ts (3484,27): Cannot find namespace ‚opentype'.

Installing opentype does not fix the issue. 安装OpenType字体解决问题。

npm install --save opentype.js

npm install --save @types/opentype.js

I would be very glad if you could help me out! 如果您能帮助我,我将非常高兴!

It looks like node_modules\\makerjs\\index.d.ts needs this added near the top of the file: 看起来node_modules\\makerjs\\index.d.ts需要在文件顶部附近添加以下内容:

/// <reference types="opentype.js" />

It fixed the build for me. 它为我修复了构建。 Can you try adding that to see if fixes for you as well? 您可以尝试添加它,看看是否也为您修复了吗? If so, I will make sure to add it in the next push. 如果是这样,我将确保在下一次推送中将其添加。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM