【问题标题】:Jhipster-generator error on production profile生产配置文件上的 Jhipster 生成器错误
【发布时间】:2017-09-23 00:00:28
【问题描述】:

我正在尝试在生产配置文件中运行我的应用程序,我将 jhipster-generator 用于 spring-boot 应用程序和 angular。该应用程序只运行页脚和背景,但应用程序的其余部分不运行,错误

Uncaught Error: [$injector:modulerr] Failed to instantiate module myAppdue to:
    Error: [$injector:nomod] Module 'myApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
    http://errors.angularjs.org/1.5.8/$injector/nomod?p0=myApp
        at http://localhost:8080/app/vendor-7004bf12ca.js:8:17716
        at http://localhost:8080/app/vendor-7004bf12ca.js:8:27870
        at n (http://localhost:8080/app/vendor-7004bf12ca.js:8:27343)
        at http://localhost:8080/app/vendor-7004bf12ca.js:8:27655
        at http://localhost:8080/app/vendor-7004bf12ca.js:9:4997
        at r (http://localhost:8080/app/vendor-7004bf12ca.js:8:18164)
        at f (http://localhost:8080/app/vendor-7004bf12ca.js:9:4845)
        at rt (http://localhost:8080/app/vendor-7004bf12ca.js:9:6774)
        at a (http://localhost:8080/app/vendor-7004bf12ca.js:8:25413)
        at ie (http://localhost:8080/app/vendor-7004bf12ca.js:8:25723)
    http://errors.angularjs.org/1.5.8/$injector/modulerr?p0=myApp&p1=Error%3A%20%5B%24injector%3Anomod%5D%20Module%20'myApp'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.5.8%2F%24injector%2Fnomod%3Fp0%3DdigitalBlogApp%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A17716%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A27870%0A%20%20%20%20at%20n%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A27343)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A27655%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A9%3A4997%0A%20%20%20%20at%20r%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A18164)%0A%20%20%20%20at%20f%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A9%3A4845)%0A%20%20%20%20at%20rt%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A9%3A6774)%0A%20%20%20%20at%20a%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A25413)%0A%20%20%20%20at%20ie%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A25723)
        at http://localhost:8080/app/vendor-7004bf12ca.js:8:17716
        at http://localhost:8080/app/vendor-7004bf12ca.js:8:27870
        at n (http://localhost:8080/app/vendor-7004bf12ca.js:8:27343)
        at http://localhost:8080/app/vendor-7004bf12ca.js:8:27655
        at http://localhost:8080/app/vendor-7004bf12ca.js:9:4997
        at r (http://localhost:8080/app/vendor-7004bf12ca.js:8:18164)
        at f (http://localhost:8080/app/vendor-7004bf12ca.js:9:4845)
        at rt (http://localhost:8080/app/vendor-7004bf12ca.js:9:6774)
        at a (http://localhost:8080/app/vendor-7004bf12ca.js:8:25413)
        at ie (http://localhost:8080/app/vendor-7004bf12ca.js:8:25723)
    http://errors.angularjs.org/1.5.8/$injector/modulerr?p0=myApp&p1=Error%3A%20%5B%24injector%3Anomod%5D%20Module%20'myApp'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.5.8%2F%24injector%2Fnomod%3Fp0%3DdigitalBlogApp%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A17716%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A27870%0A%20%20%20%20at%20n%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A27343)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A27655%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A9%3A4997%0A%20%20%20%20at%20r%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A18164)%0A%20%20%20%20at%20f%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A9%3A4845)%0A%20%20%20%20at%20rt%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A9%3A6774)%0A%20%20%20%20at%20a%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A25413)%0A%20%20%20%20at%20ie%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A25723)
        at http://localhost:8080/app/vendor-7004bf12ca.js:8:17716
        at http://localhost:8080/app/vendor-7004bf12ca.js:9:5273
        at r (http://localhost:8080/app/vendor-7004bf12ca.js:8:18164)
        at f (http://localhost:8080/app/vendor-7004bf12ca.js:9:4845)
        at rt (http://localhost:8080/app/vendor-7004bf12ca.js:9:6774)
        at a (http://localhost:8080/app/vendor-7004bf12ca.js:8:25413)
        at ie (http://localhost:8080/app/vendor-7004bf12ca.js:8:25723)
        at re (http://localhost:8080/app/vendor-7004bf12ca.js:8:24962)
        at HTMLDocument.<anonymous> (http://localhost:8080/app/vendor-7004bf12ca.js:13:25627)
        at p (http://localhost:8080/app/vendor-7004bf12ca.js:2:8692)

会是什么?

【问题讨论】:

  • 请告诉我你的节点版本
  • 您是否使用 java -jar 在本地运行 prod 构建的战争?

标签: angularjs spring-boot jhipster


【解决方案1】:

这可能是由于您在 index.html 中更改了一些内容,因为 JHipster 在构建生产环境时使用 gulp 将脚本和 css 注入其中。将您当前的版本与您在项目生成时归档在 git 中的版本进行比较。

【讨论】:

  • 正确答案,但现在我有其他问题,我下载并添加到项目中的一些自定义 javascript 文件,这些文件没有正确注入供应商,有什么想法吗?控制台给了我同样的错误控制台,但现在我知道是哪个模块失败了,但我不知道如何解决这个问题
  • 如果我的回答是正确的,请考虑采纳。我已经在 stackoverflow 上回答了这个问题,问题是您的依赖项的 bower.json 文件没有正确声明 main 属性。您必须在项目 bower.json 中使用 overrides 属性。
猜你喜欢
  • 2022-07-01
  • 1970-01-01
  • 2023-04-11
  • 1970-01-01
  • 2018-02-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-03-04
相关资源
最近更新 更多