我想将一个Angular组件从GitHub上的一个项目/模块导入到另一个项目/模块中。以下是指向测试模块的链接:带有测试组件的https://github.com/tilo-ai/test-mod。我在本地创建了另一个Angular项目并运行
npm install --save https://github.com/tilo-ai/test-mod测试模块被添加到package.json中:
"dependencies": {
"test-mod": "git+https://github.com/tilo-ai/test-mod.git",
},我尝试使用以下命令在app.module.ts中导入TestCompComponent
import { TestCompComponent } from 'test-mod';但是我得到了这个错误:
Cannot find module 'test-mod' or its corresponding type declarations.有人知道丢了什么吗?
发布于 2020-09-14 17:07:53
如果错误出现在您的编辑器中,请尝试此解决方案。https://github.com/microsoft/vscode/issues/1915
发布于 2021-10-14 09:16:22
您需要导入模块,而不是组件。我做了同样的事情,但是在那之后,我停止了对另一个错误的思考:cannot find properties of undefined(reading 'emod')。
https://stackoverflow.com/questions/63881074
复制相似问题