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

从Github存储库导入Angular组件-找不到模块或其对应的类型声明

如何解决从Github存储库导入Angular组件-找不到模块或其对应的类型声明

我想将Angular组件从GitHub上的一个Project / Module导入到另一个Project / Module。这是测试模块的链接https://github.com/tilo-ai/test-mod,带有测试组件。我在本地创建了另一个Angular Project并运行

npm install --save https://github.com/tilo-ai/test-mod

test-mod已添加到package.json:

"dependencies": {
  "test-mod": "git+https://github.com/tilo-ai/test-mod.git",},

我尝试使用

将TestCompComponent导入到我的app.module.ts中
import { TestCompComponent } from 'test-mod';

但我遇到此错误

Cannot find module 'test-mod' or its corresponding type declarations.

有人知道缺少什么吗?

解决方法

如果错误出现在编辑器中,请尝试此解决方案。 https://github.com/microsoft/vscode/issues/1915

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