Question

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.

Was it helpful?

Solution 2

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

OTHER TIPS

Ok, here is what I did on MacOS 10.10 (Yosemite) to get this to work, and it's a bit different from others. Note that I do not use sudo, but use the approach John Papa recommends.

  1. npm -g uninstall generator-angular-cordova
  2. mkdir ~/projects/node
  3. git clone https://github.com/wangshijun/generator-angular-cordova.git && cd $_
  4. npm link
  5. mkdir ~/projects/my-new-project && cd $_
  6. yo angular-cordova

It ends up asking some questions about dependencies on my machine, but I don't always see them, so the generator appears to hang.

The issue is described (and a solution provided) here: https://github.com/wangshijun/generator-angular-cordova/issues/2

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top