2017-07-02 9 views
1

私はこのエラーをもう一度打ちました。最後に私は修正しましたが、この固定されたが再び発生する方法を知らない。ngStorageモジュールはgulp distにのみ見つかりません:serve?

私はngstorageモジュールがインストールされていると、それは開発(gulp clean serve)でありますが、それは生産(gulp serve:dist)になると、それがうまく実行が、メインページが空白で、エラーがコンソールであった場合に正常に動作projecr

Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to: Error: [$injector:modulerr] Failed to instantiate module ngStorage due to: Error: [$injector:nomod] Module 'ngStorage' 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=ngStorage

私はそれがインストールされていることを確認しましたが、誰かが何が問題なのか、これを修正する方法を提案できますか?ここでの原因である可能性がありますが、必ずカント私のbower.json

{ 
    "name": "project", 
    "version": "0.1.1", 
    "dependencies": { 
    "angular-animate": "1.5.8", 
    "angular-touch": "~1.5.0", 
    "angular-sanitize": "~1.5.0", 
    "angular-messages": "~1.5.0", 
    "angular-aria": "~1.5.0", 
    "jquery": "~2.1.4", 
    "angular-resource": "~1.5.0", 
    "angular-ui-router": "~0.2.15", 
    "bootstrap": "~3.3.6", 
    "angular-bootstrap": "~1.1.2", 
    "angular-toastr": "~2.0.0", 
    "moment": "~2.13.0", 
    "animate.css": "~3.4.0", 
    "angular": "~1.5.0", 
    "ng-table": "^1.0.0", 
    "pace": "~1.0.2", 
    "metisMenu": "~2.0.2", 
    "fontawesome": "~4.5.0", 
    "roboto-fontface": "^0.7.0", 
    "angular-ui-validate": "^1.2.2", 
    "ng-stomp": "^0.2.0", 
    "angular-scrollable-table": "^1.1.1", 
    "aws-sdk": "aws-sdk-js#^2.7.7", 
    "ng-file-upload": "^12.2.13", 
    "angular-recaptcha": "^4.0.3", 
    "ng-csv": "^0.3.6", 
    "ngstorage": "^0.3.11", 
    "intl-tel-input": "5.1.7", 
    "international-phone-number": "^0.0.16", 
    "angular-chart.js": "^1.1.1" 
    }, 
    "devDependencies": { 
    "angular-mocks": "1.5.8" 
    }, 
    "overrides": { 
    "bootstrap": { 
     "main": [ 
     "less/bootstrap.less", 
     "dist/fonts/glyphicons-halflings-regular.eot", 
     "dist/fonts/glyphicons-halflings-regular.svg", 
     "dist/fonts/glyphicons-halflings-regular.ttf", 
     "dist/fonts/glyphicons-halflings-regular.woff", 
     "dist/fonts/glyphicons-halflings-regular.woff2" 
     ] 
    }, 
    "fontawesome": { 
     "main": [ 
     "less/font-awesome.less", 
     "fonts/fontawesome-webfont.eot", 
     "fonts/fontawesome-webfont.svg", 
     "fonts/fontawesome-webfont.ttf", 
     "fonts/fontawesome-webfont.woff", 
     "fonts/fontawesome-webfont.woff2" 
     ] 
    }, 
    "roboto-fontface": { 
     "main": [ 
     "css/roboto/less/roboto-fontface.less" 
     ] 
    }, 
    "chart.js": { 
       "main": [ 
        "dist/Chart.bundle.min.js" 
       ] 
      } 
    }, 
    "resolutions": { 
    "jquery": "~2.1.4", 
    "angular": "1.5.8" 
    },  
    "description": "Project Manager On-Premise", 
    "main": "", 
    "homepage": "index.html", 
    "ignore": [ 
    "**/.*", 
    "node_modules", 
    "bower_components", 
    "test", 
    "tests" 
    ] 
} 

私がまたは私がbroswer同期を使用していますstmopに関連した問題があると思い、あります。

console image

答えて

1

問題はそれに欠けているセミコロンをincluded--さ--whichライブラリのいずれかに会費がjsのメインファイル

原因だた参照してください。

私は私のプロジェクトでng-stompを使用していたし、このライブラリをbower installでインストールしました。gulp dist:serveを実行すると、bower.jsonファイルに記載されているすべてのファイルが圧縮され、bower_components/ng-stomp/package.jso nメインファイルの場所は"main": "src/ng-stomp.js"でした。このファイルの最後にセミコロンがないので、次のjsライブラリ(ngStorage)が縮小されると、パーサーが認識せず、エラーをスローします。

ソリューション:

オーバーライド私のbower.jsonオーバーライドブロック(最後にセミコロンを持ってNG-stomp.min.jsを追加)

内のコードの下に書き込むことにより、メインファイル
"ng-stomp": { 
      "main": [ 
       "dist/ng-stmop.min.js" 
      ] 
     } 

誰かを助けることを願って

関連する問題