0

私は MEAN を初めて使用するので、yeoman ジェネレーターを使用して CopyWars というゲームを作成しようと考えました。

再作成する手順は次のとおりです。

mongodb をインストールして実行し、npm をインストールします。

sudo npm install -g generator-meanjs
mkdir copywars-meanjs
cd copywars-meanjs
yo meanjs
yo meanjs:angular-module copywars
grunt test

そして、ここに私が得るエラーがあります:

    Error: [$injector:modulerr] Failed to instantiate module copywars due to:
    Error: [$injector:modulerr] Failed to instantiate module core due to:
    Error: [$injector:unpr] Unknown provider: $stateProvider
    http://errors.angularjs.org/1.2.16/$injector/unpr?p0=%24stateProvider
        at /home/intrepion/Code/MEAN/copywars-meanjs/public/lib/angular/angular.js:3705
        at getService (/home/intrepion/Code/MEAN/copywars-meanjs/public/lib/angular/angular.js:3832)
        at invoke (/home/intrepion/Code/MEAN/copywars-meanjs/public/lib/angular/angular.js:3859)
        at /home/intrepion/Code/MEAN/copywars-meanjs/public/lib/angular/angular.js:3788
    http://errors.angularjs.org/1.2.16/$injector/modulerr?p0=core&p1=Error%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20%24stateProvider%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.2.16%2F%24injector%2Funpr%3Fp0%3D%2524stateProvider%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3705%0A%20%20%20%20at%20getService%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3832)%0A%20%20%20%20at%20invoke%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3859)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3788
        at /home/intrepion/Code/MEAN/copywars-meanjs/public/lib/angular/angular.js:3810
    http://errors.angularjs.org/1.2.16/$injector/modulerr?p0=copywars&p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20Failed%20to%20instantiate%20module%20core%20due%20to%3A%0AError%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20%24stateProvider%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.2.16%2F%24injector%2Funpr%3Fp0%3D%2524stateProvider%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3705%0A%20%20%20%20at%20getService%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3832)%0A%20%20%20%20at%20invoke%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3859)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3788%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.2.16%2F%24injector%2Fmodulerr%3Fp0%3Dcore%26p1%3DError%253A%2520%255B%2524injector%253Aunpr%255D%2520Unknown%2520provider%253A%2520%2524stateProvider%250Ahttp%253A%252F%252Ferrors.angularjs.org%252F1.2.16%252F%2524injector%252Funpr%253Fp0%253D%252524stateProvider%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A9876%252Fbase%252Fpublic%252Flib%252Fangular%252Fangular.js%253F7dcf1b25480258d399759429338cedc57239f2d1%253A3705%250A%2520%2520%2520%2520at%2520getService%2520(http%253A%252F%252Flocalhost%253A9876%252Fbase%252Fpublic%252Flib%252Fangular%252Fangular.js%253F7dcf1b25480258d399759429338cedc57239f2d1%253A3832)%250A%2520%2520%2520%2520at%2520invoke%2520(http%253A%252F%252Flocalhost%253A9876%252Fbase%252Fpublic%252Flib%252Fangular%252Fangular.js%253F7dcf1b25480258d399759429338cedc57239f2d1%253A3859)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A9876%252Fbase%252Fpublic%252Flib%252Fangular%252Fangular.js%253F7dcf1b25480258d399759429338cedc57239f2d1%253A3788%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3810
        at /home/intrepion/Code/MEAN/copywars-meanjs/public/lib/angular/angular.js:3810
    Error: [$injector:modulerr] Failed to instantiate module copywars due to:
    Error: [$injector:modulerr] Failed to instantiate module core due to:
    Error: [$injector:unpr] Unknown provider: $stateProvider
    http://errors.angularjs.org/1.2.16/$injector/unpr?p0=%24stateProvider
        at /home/intrepion/Code/MEAN/copywars-meanjs/public/lib/angular/angular.js:3705
        at getService (/home/intrepion/Code/MEAN/copywars-meanjs/public/lib/angular/angular.js:3832)
        at invoke (/home/intrepion/Code/MEAN/copywars-meanjs/public/lib/angular/angular.js:3859)
        at /home/intrepion/Code/MEAN/copywars-meanjs/public/lib/angular/angular.js:3788
    http://errors.angularjs.org/1.2.16/$injector/modulerr?p0=core&p1=Error%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20%24stateProvider%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.2.16%2F%24injector%2Funpr%3Fp0%3D%2524stateProvider%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3705%0A%20%20%20%20at%20getService%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3832)%0A%20%20%20%20at%20invoke%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3859)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3788
        at /home/intrepion/Code/MEAN/copywars-meanjs/public/lib/angular/angular.js:3810
    http://errors.angularjs.org/1.2.16/$injector/modulerr?p0=copywars&p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20Failed%20to%20instantiate%20module%20core%20due%20to%3A%0AError%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20%24stateProvider%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.2.16%2F%24injector%2Funpr%3Fp0%3D%2524stateProvider%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3705%0A%20%20%20%20at%20getService%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3832)%0A%20%20%20%20at%20invoke%20(http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3859)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3788%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.2.16%2F%24injector%2Fmodulerr%3Fp0%3Dcore%26p1%3DError%253A%2520%255B%2524injector%253Aunpr%255D%2520Unknown%2520provider%253A%2520%2524stateProvider%250Ahttp%253A%252F%252Ferrors.angularjs.org%252F1.2.16%252F%2524injector%252Funpr%253Fp0%253D%252524stateProvider%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A9876%252Fbase%252Fpublic%252Flib%252Fangular%252Fangular.js%253F7dcf1b25480258d399759429338cedc57239f2d1%253A3705%250A%2520%2520%2520%2520at%2520getService%2520(http%253A%252F%252Flocalhost%253A9876%252Fbase%252Fpublic%252Flib%252Fangular%252Fangular.js%253F7dcf1b25480258d399759429338cedc57239f2d1%253A3832)%250A%2520%2520%2520%2520at%2520invoke%2520(http%253A%252F%252Flocalhost%253A9876%252Fbase%252Fpublic%252Flib%252Fangular%252Fangular.js%253F7dcf1b25480258d399759429338cedc57239f2d1%253A3859)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A9876%252Fbase%252Fpublic%252Flib%252Fangular%252Fangular.js%253F7dcf1b25480258d399759429338cedc57239f2d1%253A3788%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9876%2Fbase%2Fpublic%2Flib%2Fangular%2Fangular.js%3F7dcf1b25480258d399759429338cedc57239f2d1%3A3810
        at /home/intrepion/Code/MEAN/copywars-meanjs/public/lib/angular/angular.js:3810
4

1 に答える 1

1

さて、私は自分の問題を理解しました。

「yo meanjs」を実行すると、最初に尋ねられる質問は「アプリケーションを何と呼びますか?」です。

どのような回答をしても、同じ名前のモジュールを作成すると問題が発生します。

アプリケーションを「copywars」と呼んでいたので、「copywar」または「copywars」というモジュールを作成するたびにエラーが発生しました。アプリケーション名を変更するか、モジュール名を変更することでこれを回避できます。

于 2014-05-14T06:33:29.297 に答える