如何处理AOT编译失败的npm包

How to deal with a npm package whose AOT compilation fails

我是一个完全的网络开发新手,现在我面临着一个我不知道如何处理的问题。

我正在使用名为 @uniprank/ngx-file-uploaderhttps://www.npmjs.com/package/@uniprank/ngx-file-uploader) in my web application. When compiling it with JIT compilation it works with no problems. However, now I would like to turn my application to production mode, so I tried AOT compilation, and a problem is found. This package breaks when I try to compile my application with the Angular compiler, as it is shown here: https://angular.io/guide/aot-compiler)的 npm 包。显示的消息如下:

Unexpected value 'undefined' exported by the module 'FileUploaderModule in /node_modules/@uniprank/ngx-file-uploader/typings/index.d.ts'

在包的 Github 存储库 (https://github.com/uniprank/ngx-file-uploader/issues/3) 的一个问题中,我注意到这可能是包本身的问题。

此时我完全迷失了。我知道这是一个非常笼统的问题,但我不知道如何处理这个问题。我应该处理包裹本身吗?如果是这样,我是否必须创建一个新的 npm 包以将其添加到我的 package.json 并在执行命令 npm install 时将其包含在我的应用程序中?

如有任何帮助,我们将不胜感激。谢谢。

如果您可以解决第 3 方包中的问题,那么请向此回购请求。 或者你可以 fork 这个 repo 并自己解决问题。然后将 package.json link 包含到您的回购中。例如:你的回购名称 user/package 然后你可以写 npm install user/package