Search code examples
cordovayeoman-generator

yeoman generator-angular-cordova errors


I have a problem installing an angular cordova app with yeoman. (more specifically this generator.)

Here's what happens:

$ yo angular-cordova

     _-----_
    |       |
    |--(o)--|   .--------------------------.
   `---------´  |    Welcome to Yeoman,    |
    ( _´U`_ )   |   ladies and gentlemen!  |
    /___A___\   '__________________________'
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

Out of the box I include Ionic and some AngularJS recommended modules.

[?] What is the name of your app? (Spaces aren't allowed) HelloCordova
[?] What would you like the package to be? io.cordova.hellocordova
[?] What platforms would you like to add support for? Android, iOS
[?] What plugins would you like to include by default? 
[?] Would you like to copy some sample icons for cordova? Yes
Creating cordova app: helloCordova

/usr/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error: ENOENT, no such file or directory '/home/leoha/projects/mobile-app-v2/www/js/index.js'
    at Object.fs.unlinkSync (fs.js:760:18)
    at /usr/lib/node_modules/generator-angular-cordova/app/index.js:246:16
    at _rejected (/usr/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:808:24)
    at /usr/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:834:30
    at Promise.when (/usr/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:1079:31)
    at Promise.promise.promiseDispatch (/usr/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:752:41)
    at /usr/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:821:14
    at flush (/usr/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:419:13)

If someone knows how to solve this, I'd be really grateful.


Solution

  • I got it and fixed it.

    I just installed the generator (locally and not globally)

    C:\PhoneGap\Workspace\Demos\cordovayeoman>npm install generator-angular-cordova
    

    after the successful installation of the package. When I ran: "yo angular-cordova" I got the same exception (see snapshot)

    enter image description here

    then I created another folder (MyCordovaApp) inside "the folder" where I installed/configured the generator plugin i.e.

    From:   C:\PhoneGap\Workspace\Demos\cordovayeoman\
    
    To:   C:\PhoneGap\Workspace\Demos\cordovayeoman\MyCordovaApp
    

    Now here I ran again: "yo angular-cordova" and it worked well :) (see snapshot)

    enter image description here

    Note:- I had selected iOS platform that's why it given me excetion while generating stuff for iOS on Windows machine.

    and here is the generated stuff.

    enter image description here