[英]ERROR in No NgModule metadata found for 'AppModule'
I'm using Angular 6.0.7. 我正在使用Angular 6.0.7。 I'm trying to debug one of my packages locally.
我正在尝试在本地调试其中一个软件包。 For that I'm using
npm link
. 为此,我正在使用
npm link
。 But when I try to serve the application it throws an error, 但是,当我尝试为应用程序提供服务时,会引发错误,
ERROR in No NgModule metadata found for 'AppModule'.
找不到“ AppModule”的NgModule元数据中的错误。
Following are the steps I followed to link my package 以下是我链接我的包裹所遵循的步骤
npm link
on my package folder npm link
npm link my-package
on my application folder npm link my-package
到我的应用程序文件夹中 "include": ["./node_modules/my-package"]
"include": ["./node_modules/my-package"]
为"include": ["./node_modules/my-package"]
And on the angular.json file "preserveSymlinks": true
. 并在angular.json文件
"preserveSymlinks": true
。 Before linking the package locally the application works perfectly. 在本地链接包之前,应用程序可以正常运行。 Am I missing something here?
我在这里想念什么吗? Any help would be appreciated.
任何帮助,将不胜感激。
I was able to fix my issue by doing some changes to the tsconfig file. 通过对tsconfig文件进行一些更改,我能够解决我的问题。 Hope this helps someone whose having a similar issue.
希望这对遇到类似问题的人有所帮助。 I had to include the
.ts
files in my tsconfig like below, 我必须将
.ts
文件包括在我的tsconfig中,如下所示,
"include": [
"**/*.ts",
"./node_modules/my-package"
]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.