6

我正在使用 asp.net core 2x 和 angular 5 构建 Web 应用程序,在开发/调试模式下,一切都构建得很好。但是当我尝试在 Visual Studio 2017 中以发布模式发布它时,我收到了这个错误。请帮助我解决这个问题。我没有在我的代码中使用它,但它存在。装饰器不支持函数调用,但在“Injectable”中调用了“makeParamDecorator”。“Injectable”调用“makeParamDecorator”。请帮助。提前致谢。我的错误消息的屏幕截图

4

1 回答 1

14

您需要在控制台上运行它: node node_modules/webpack/bin/webpack.js --env.prod

然后你会得到所有问题的列表,并且需要解决所有问题,有人会像:

ERROR in navmenu.component.html: Property 'auth' is protected and only accessible within class 'NavMenuComponent' and its subclasses.

另一个案例:

ERROR in Error at estados.component.html(19,72): Expected 0 arguments, but got 1.
Error at home.component.html(8,12): Property 'selectedCharacter' does not exist on type 'HomeComponent'. Did you mean 'selectedCharacters'?

每个错误都有不同的解决方案,您需要全部解决。

您可以查看此链接: Angular – The command “node node_modules/webpack/bin/webpack.js –env.prod” exited with code 2 and similar errors: how to fix them

于 2018-02-11T07:58:10.927 回答