Ionic 2:在app app / ionic-anguler中寻找模块不存在(模块作为目录)

时间:2016-03-04 09:41:42

标签: ionic2

serve离子2 app。

时出错
'looking for modules in app
    app/ionic-anguler doesn't exist (module as directory)
    resolve 'file' ionic-anguler in app
      resolve file
        app/ionic-anguler doesn't exist
        app/ionic-anguler.js doesn't exist'

任何人都可以帮助我。谢谢

home.js

    import {Page, NavController} from 'ionic-angular';
import {Page2} from '../page2/page2';

@Page({
  templateUrl: 'build/pages/home/home.html'

})
export class HomePage {
    static get parameters(){
        return [[NavController]];
    }

    constructor(nav){
        this.nav = nav;
    }

    go_to_page_2(){
        this.nav.push(Page2);
    }
}

错误日志

./app/pages/home/home.js
Module not found: Error: Cannot resolve module 'ionic-anguler' in /Users/kosala/Desktop/IonicProjects/test_three/app/app/pages/home
resolve module ionic-anguler in /Users/kosala/Desktop/IonicProjects/test_three/app/app/pages/home
  looking for modules in app
    app/ionic-anguler doesn't exist (module as directory)
    resolve 'file' ionic-anguler in app
      resolve file
        app/ionic-anguler doesn't exist
        app/ionic-anguler.js doesn't exist
  looking for modules in /Users/kosala/Desktop/IonicProjects/test_three/app/node_modules
    /Users/kosala/Desktop/IonicProjects/test_three/app/node_modules/ionic-anguler doesn't exist (module as directory)
    resolve 'file' ionic-anguler in /Users/kosala/Desktop/IonicProjects/test_three/app/node_modules
      resolve file
        /Users/kosala/Desktop/IonicProjects/test_three/app/node_modules/ionic-anguler doesn't exist
        /Users/kosala/Desktop/IonicProjects/test_three/app/node_modules/ionic-anguler.js doesn't exist
[app/ionic-anguler]
[app/ionic-anguler]
[app/ionic-anguler.js]
[/Users/kosala/Desktop/IonicProjects/test_three/app/node_modules/ionic-anguler]
[/Users/kosala/Desktop/IonicProjects/test_three/app/node_modules/ionic-anguler]
[/Users/kosala/Desktop/IonicProjects/test_three/app/node_modules/ionic-anguler.js]
 @ ./app/pages/home/home.js 12:20-44,./app/pages/page2/page2.js
Module not found: Error: Cannot resolve module 'ionic-anguler' in /Users/kosala/Desktop/IonicProjects/test_three/app/app/pages/page2
resolve module ionic-anguler in /Users/kosala/Desktop/IonicProjects/test_three/app/app/pages/page2
  looking for modules in app
    resolve 'file' ionic-anguler in app
      resolve file
        app/ionic-anguler doesn't exist
        app/ionic-anguler.js doesn't exist
    app/ionic-anguler doesn't exist (module as directory)
  looking for modules in /Users/kosala/Desktop/IonicProjects/test_three/app/node_modules
    resolve 'file' ionic-anguler in /Users/kosala/Desktop/IonicProjects/test_three/app/node_modules
      resolve file
        /Users/kosala/Desktop/IonicProjects/test_three/app/node_modules/ionic-anguler doesn't exist
        /Users/kosala/Desktop/IonicProjects/test_three/app/node_modules/ionic-anguler.js doesn't exist
    /Users/kosala/Desktop/IonicProjects/test_three/app/node_modules/ionic-anguler doesn't exist (module as directory)
[app/ionic-anguler]
[app/ionic-anguler.js]
[app/ionic-anguler]
[/Users/kosala/Desktop/IonicProjects/test_three/app/node_modules/ionic-anguler]
[/Users/kosala/Desktop/IonicProjects/test_three/app/node_modules/ionic-anguler.js]
[/Users/kosala/Desktop/IonicProjects/test_three/app/node_modules/ionic-anguler]
 @ ./app/pages/page2/page2.js 10:20-44 (CLI v2.0.0-beta.19)

2 个答案:

答案 0 :(得分:1)

你已经检查了这个吗?即将到来的Ionic 2 Starter Change https://forum.ionicframework.com/t/attention-upcoming-ionic-2-starter-changes/45058

答案 1 :(得分:0)

你有一个错字。应该是ionic-angular而不是ionic-anguler