wangshijun / generator-angular-cordova

Yeoman Generator for a Angular-Ionic-Cordova powered webapp
25 stars 9 forks source link

Error after selecting modules #2

Open maximilienborne opened 10 years ago

maximilienborne commented 10 years ago

I have an error just after the step where i have to choose modules to install :

/usr/local/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/lib/actions/actions.js:194 throw new Error('Unable to read "' + filepath + '" file (Error code: ' + e ^ Error: Unable to read "/usr/local/lib/node_modules/generator-angular-cordova/templates/common/index.html" file (Error code: ENOENT). at Generator.read (/usr/local/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/lib/actions/actions.js:194:11) at Generator.readIndex (/usr/local/lib/node_modules/generator-angular-cordova/app/index.js:376:39) at /usr/local/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/lib/base.js:341:43 at /usr/local/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:551:21 at /usr/local/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:227:13 at iterate (/usr/local/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:134:13) at /usr/local/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:145:25 at /usr/local/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:229:17 at /usr/local/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:556:34 at /usr/local/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/lib/base.js:327:11

hartman commented 10 years ago

Same here...

TolotraRam commented 10 years ago

here too, think it doesn't support windows path

krimple commented 10 years ago

I am trying this on Mac OS X Mavericks, and have cordova, the generator, yeoman, the grunt client, etc, installed. I get a similar error. I am using (and this may be important or not) nvm to install and use my node platforms. I'm on 0.10.26.

[?] Would you like to use Sass (with Compass)? No
[?] Would you like to include Ionic: Yes
[?] Which modules would you like to include? angular-resource.js, angular-cookies.js, angular-sanitize.js

/Users/kenrimple/.nvm/v0.10.26/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/lib/actions/actions.js:194
    throw new Error('Unable to read "' + filepath + '" file (Error code: ' + e
          ^
Error: Unable to read "/Users/kenrimple/.nvm/v0.10.26/lib/node_modules/generator-angular-cordova/templates/common/index.html" file (Error code: ENOENT).
    at Generator.read (/Users/kenrimple/.nvm/v0.10.26/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/lib/actions/actions.js:194:11)
    at Generator.readIndex (/Users/kenrimple/.nvm/v0.10.26/lib/node_modules/generator-angular-cordova/app/index.js:376:39)
    at /Users/kenrimple/.nvm/v0.10.26/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/lib/base.js:341:43
    at /Users/kenrimple/.nvm/v0.10.26/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:551:21
    at /Users/kenrimple/.nvm/v0.10.26/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:227:13
    at iterate (/Users/kenrimple/.nvm/v0.10.26/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:134:13)
    at /Users/kenrimple/.nvm/v0.10.26/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:145:25
    at /Users/kenrimple/.nvm/v0.10.26/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:229:17
    at /Users/kenrimple/.nvm/v0.10.26/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:556:34
    at /Users/kenrimple/.nvm/v0.10.26/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/lib/base.js:327:11
mcanever commented 10 years ago

Hi, same issue here: [?] Which modules would you like to include? angular-resource.js, angular-cookies.js, angular-sanitize.js

/home/matteo/local/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/lib/actions/actions.js:194 throw new Error('Unable to read "' + filepath + '" file (Error code: ' + e ^ Error: Unable to read "/home/matteo/local/lib/node_modules/generator-angular-cordova/templates/common/index.html" file (Error code: ENOENT). at Generator.read (/home/matteo/local/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/lib/actions/actions.js:194:11) at Generator.readIndex (/home/matteo/local/lib/node_modules/generator-angular-cordova/app/index.js:376:39) I'm quite a noob with node but I'll try to find the bug and submit a pull

ValentinCreative commented 10 years ago

Hi, same issue on Mavericks

keshavos commented 10 years ago

Still having the same issue on windows.

fergalmoran commented 10 years ago

Same here on linux. Shame - this looks like a really nice project.

funklos commented 10 years ago

same issue here

evandertino commented 10 years ago

me too, same issue on Ubuntu 14.04

[?] Would you like to use Sass (with Compass)? Yes [?] Would you like to include Ionic: Yes [?] Would you like to use the Sass version of Ionic: Yes [?] Which modules would you like to include? angular-resource.js, angular-cookies.js, angular-sanitize.js

/home/bergman/opt/node/node-v0.10.28/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/lib/actions/actions.js:194 throw new Error('Unable to read "' + filepath + '" file (Error code: ' + e ^ Error: Unable to read "/home/bergman/opt/node/node-v0.10.28/lib/node_modules/generator-angular-cordova/templates/common/index.html" file (Error code: ENOENT). at Generator.read (/home/bergman/opt/node/node-v0.10.28/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/lib/actions/actions.js:194:11) at Generator.readIndex (/home/bergman/opt/node/node-v0.10.28/lib/node_modules/generator-angular-cordova/app/index.js:376:39) at /home/bergman/opt/node/node-v0.10.28/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/lib/base.js:341:43 at /home/bergman/opt/node/node-v0.10.28/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:551:21 at /home/bergman/opt/node/node-v0.10.28/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:227:13 at iterate (/home/bergman/opt/node/node-v0.10.28/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:134:13) at /home/bergman/opt/node/node-v0.10.28/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:145:25 at /home/bergman/opt/node/node-v0.10.28/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:229:17 at /home/bergman/opt/node/node-v0.10.28/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/node_modules/async/lib/async.js:556:34 at /home/bergman/opt/node/node-v0.10.28/lib/node_modules/generator-angular-cordova/node_modules/yeoman-generator/lib/base.js:327:11

bmwertman commented 10 years ago

I think this is the same issue I've encountered:

[?] Would you like to copy some sample icons for cordova? Yes Creating cordova app: carRepair

/usr/local/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:12[?] Would you like to copy some sample icons for cordova? Yes Creating cordova app: carRepair

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

skashi commented 10 years ago

I'm getting the same issue as everyone else here. I found this post: http://stackoverflow.com/questions/23679910/yeoman-generator-angular-cordova-errors

An answer but no explanation as of yet how it was resolved but maybe that link will open up a think tank on how to fix this error!

rfryca commented 10 years ago

npm install -g generator-angular-cordova does not install all necessary files and directories. there is only app folder inside generator-angular-cordova in your node modules global repository folder.

You can clone repository https://github.com/wangshijun/generator-angular-cordova.git into '/Users/529/.nodebrew/node/v0.11.11/lib/node_modules/generator-angular-cordova' or other place where you have your generator-angular-cordova module installed

This will create all necessary files (including templates/common/index.html)

mablay commented 10 years ago

Thanks rfryca, that solved it for me. The default path for mac users is:

/usr/local/lib/node_modules/generator-angular-cordova
ghost commented 10 years ago

@rfryca Works for me too. Just one thing to mention - you'll need to run npm install after cloning the repo to make sure that the dependencies are all included.

CaptainChainsaw commented 10 years ago

I tried cloning the previously mentioned repo: https://github.com/wangshijun/generator-angular-cordova.git

This is what I get on Ubuntu 14:

Creating cordova app: helloCordova

/usr/local/lib/node_modules/generator-angular-cordova/node_modules/cordova/node_modules/q/q.js:126 throw e; ^ Error: ENOENT, no such file or directory '/usr/local/lib/node_modules/generator-angular-cordova/www/js/index.js'

WillForan commented 9 years ago

after npm generator-angular-cordova I pulled in the template files like svn co https://github.com/wangshijun/generator-angular-cordova/trunk/templates ~/node_modules/generator-angular-cordova/templates

liltof commented 9 years ago

I've tried this, and it worked (cloning the repo) but now I have another problem : The yo wizard runs twice each time I do "yo angular-cordova", and the second time fails (I imagin that's because the directory is not empty) but if I stop (with ctrl+C) the second run, I don't have anything in the js directory (so no app.js, and no index controller). I've uninstalled and reinstalled yo, cordova, and the generators but have the same results. I'm on ubuntu 14.04 Edit : Ok, solved by removing generator-angular-cordova directory, cloning the repo, cd into it, and npm install. npm install generator-angular-cordova doesn't seem to work at all for me

marcussaad commented 9 years ago

@liltof, right on. For anyone who is facing this issue, please follow the steps given by him, which are (For Debian based Unix):

  1. rm -rf /usr/lib/node_modules/generator-angular-cordova
  2. cd /usr/lib/node_modules/ && git clone https://github.com/wangshijun/generator-angular-cordova.git && cd $_
  3. npm install

Warning: sudo usage is on you.

walkingriver commented 9 years ago

Ok, here is what I did on MacOS 10.10 (Yosemite) to get this to work, and it's similar to what @marcussaad did above. 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.

ttbarnes commented 9 years ago

Same issue here. Since this is a generator, it should generate everything correctly.

You shouldn't have to do any workarounds. This is issue has been open for nearly 1.5 years @wangshijun . Also, out of the only 3 issues ever opened in this repo, they are all pretty much the same issue. You should really attend to these, at least with a reply.

ttbarnes commented 9 years ago

Anyone for the future - use this generator instead:

https://github.com/keshavos/generator-angularjs-cordova

At the time of writing, it works 'out of the box', like a generator should.