generator-angular icon indicating copy to clipboard operation
generator-angular copied to clipboard

Bug using 'yo angular'

Open murilolobato opened this issue 11 years ago • 50 comments

If I follow the instructions at readme.md, after I execute 'yo angular' I can see that a conflict is happening with package.json, and the terminal ask's if I want to overwrite the file or not. If I dont press any key the process continues, but after the message "Done, without errors." i'm not sent back to bash, and if I hit any key, the overwrite message appears again.

murilolobato avatar Apr 30 '15 14:04 murilolobato

+1

ghost avatar May 02 '15 18:05 ghost

same here

TheWrongAlice avatar May 05 '15 12:05 TheWrongAlice

+1

mogupta avatar May 05 '15 19:05 mogupta

If I follow the instructions at readme.md, after I execute 'yo angular' I can see that a conflict is happening with package.json, and the terminal ask's if I want to overwrite the file or not.

That's generally because the package.json file already exists where you're trying to generate it. Are you in a totally empty directory?

arthurvr avatar May 06 '15 19:05 arthurvr

Absolutely in a fresh directory. I think perhaps the yeoman generator is creating package.json, then trying to create it a second time.

ghost avatar May 06 '15 19:05 ghost

Yes , in a fresh directory.

Note : this is happening only on windows 8. I installed nodejs using the node installer. On May 6, 2015 3:36 PM, "CaptSaltyJack" [email protected] wrote:

Absolutely in a fresh directory. I think perhaps the yeoman generator is creating package.json, then trying to create it a second time.

— Reply to this email directly or view it on GitHub https://github.com/yeoman/generator-angular/issues/1071#issuecomment-99582379 .

mogupta avatar May 06 '15 19:05 mogupta

Nope, happening on Mac OS too. :)

ghost avatar May 06 '15 19:05 ghost

Confirmed, I have this issue on Mac

TheWrongAlice avatar May 06 '15 19:05 TheWrongAlice

I have the same issue on Ubuntu.

ghost avatar May 07 '15 20:05 ghost

I have the same issue, on Mac (yo --version 1.4.6)

It seams to be related to the installation of karma packages which rewrites the package.json adding devDependencies to the karma packages

I ran the generator twice, once answering Yes and once answering No to "Overwrite package.json?" Here are the differences among the two apps

The rewritten package.json has "grunt-karma", "karma-jasmine",

$ diff norewrite/package.json sandbox/package.json 
2c2
<   "name": "norewrite",
---
>   "name": "sandbox",
22a23
>     "grunt-karma": "*",
28a30,31
>     "karma-jasmine": "*",
>     "karma-phantomjs-launcher": "*",
33a37,39
>   },
>   "scripts": {
>     "test": "grunt test"
35c41
< }
---
> }

here are the corresponding node_modules/ folders

$ ls -gG sandbox/node_modules/
total 0
drwxr-xr-x  11 staff  374 May  9 10:05 grunt
drwxr-xr-x   8 staff  272 May  9 10:05 grunt-autoprefixer
drwxr-xr-x   6 staff  204 May  9 10:05 grunt-concurrent
drwxr-xr-x   7 staff  238 May  9 10:05 grunt-contrib-clean
drwxr-xr-x   6 staff  204 May  9 10:05 grunt-contrib-compass
drwxr-xr-x   6 staff  204 May  9 10:05 grunt-contrib-concat
drwxr-xr-x   7 staff  238 May  9 10:05 grunt-contrib-connect
drwxr-xr-x   7 staff  238 May  9 10:05 grunt-contrib-copy
drwxr-xr-x   7 staff  238 May  9 10:05 grunt-contrib-cssmin
drwxr-xr-x   6 staff  204 May  9 10:05 grunt-contrib-htmlmin
drwxr-xr-x   7 staff  238 May  9 10:05 grunt-contrib-imagemin
drwxr-xr-x   7 staff  238 May  9 10:05 grunt-contrib-jshint
drwxr-xr-x   7 staff  238 May  9 10:05 grunt-contrib-uglify
drwxr-xr-x   7 staff  238 May  9 10:05 grunt-contrib-watch
drwxr-xr-x   6 staff  204 May  9 10:05 grunt-filerev
drwxr-xr-x   6 staff  204 May  9 10:05 grunt-google-cdn
drwxr-xr-x  17 staff  578 May  9 10:07 grunt-karma        <------
drwxr-xr-x  14 staff  476 May  9 10:05 grunt-newer
drwxr-xr-x   6 staff  204 May  9 10:05 grunt-ng-annotate
drwxr-xr-x   7 staff  238 May  9 10:05 grunt-svgmin
drwxr-xr-x   7 staff  238 May  9 10:05 grunt-usemin
drwxr-xr-x   9 staff  306 May  9 10:05 grunt-wiredep
drwxr-xr-x  15 staff  510 May  9 10:07 jasmine-core
drwxr-xr-x   8 staff  272 May  9 10:05 jshint-stylish
drwxr-xr-x  16 staff  544 May  9 10:07 karma                 <---------
drwxr-xr-x   7 staff  238 May  9 10:07 karma-jasmine        <----------
drwxr-xr-x   6 staff  204 May  9 10:07 karma-phantomjs-launcher      <----------
drwxr-xr-x   6 staff  204 May  9 10:05 load-grunt-tasks
drwxr-xr-x   7 staff  238 May  9 10:05 time-grunt

$ ls -gG  norewrite/node_modules/
total 0
drwxr-xr-x  11 staff  374 May  9 10:11 grunt
drwxr-xr-x   8 staff  272 May  9 10:11 grunt-autoprefixer
drwxr-xr-x   6 staff  204 May  9 10:11 grunt-concurrent
drwxr-xr-x   7 staff  238 May  9 10:11 grunt-contrib-clean
drwxr-xr-x   6 staff  204 May  9 10:11 grunt-contrib-compass
drwxr-xr-x   6 staff  204 May  9 10:11 grunt-contrib-concat
drwxr-xr-x   7 staff  238 May  9 10:11 grunt-contrib-connect
drwxr-xr-x   7 staff  238 May  9 10:11 grunt-contrib-copy
drwxr-xr-x   7 staff  238 May  9 10:11 grunt-contrib-cssmin
drwxr-xr-x   6 staff  204 May  9 10:11 grunt-contrib-htmlmin
drwxr-xr-x   7 staff  238 May  9 10:11 grunt-contrib-imagemin
drwxr-xr-x   7 staff  238 May  9 10:11 grunt-contrib-jshint
drwxr-xr-x   7 staff  238 May  9 10:11 grunt-contrib-uglify
drwxr-xr-x   7 staff  238 May  9 10:11 grunt-contrib-watch
drwxr-xr-x   6 staff  204 May  9 10:11 grunt-filerev
drwxr-xr-x   6 staff  204 May  9 10:11 grunt-google-cdn
drwxr-xr-x  14 staff  476 May  9 10:11 grunt-newer
drwxr-xr-x   6 staff  204 May  9 10:11 grunt-ng-annotate
drwxr-xr-x   7 staff  238 May  9 10:11 grunt-svgmin
drwxr-xr-x   7 staff  238 May  9 10:11 grunt-usemin
drwxr-xr-x   9 staff  306 May  9 10:11 grunt-wiredep
drwxr-xr-x   8 staff  272 May  9 10:11 jshint-stylish
drwxr-xr-x   6 staff  204 May  9 10:11 load-grunt-tasks
drwxr-xr-x   7 staff  238 May  9 10:11 time-grunt```

klode avatar May 09 '15 14:05 klode

My "solution" to this problem was to install an earlier version of the generator (0.7.1) which worked nicely for me.

TheWrongAlice avatar May 14 '15 21:05 TheWrongAlice

What I need to do to install a earlier version?

murilolobato avatar May 15 '15 00:05 murilolobato

@murilolobato

First uninstall your current version: npm uninstall generator-angular

Then install specific version like so: npm install [email protected]

TheWrongAlice avatar May 15 '15 07:05 TheWrongAlice

I am also getting the same issue on Mac

h-arora avatar May 18 '15 17:05 h-arora

same issue on Ubuntu... But in addition I am also receiving following message:

npm WARN optional dep failed, continuing [email protected]
npm WARN optional dep failed, continuing [email protected]
npm WARN optional dep failed, continuing [email protected]

and at the end, following error message:

events.js:72
    throw er; // Unhandled 'error' event
          ^
Error: spawn ENOENT
   at errnoException (child_process.js:1011:11)
   at Process.ChildProcess._handle.onexit (child_process.js:802:34)

zishanj avatar May 22 '15 05:05 zishanj

Same issue on a windows 8 machine...

fabwu avatar May 29 '15 14:05 fabwu

I was able to confirm this issue. Thanks everybody. Hopefully somebody will have to time to dig into this issue quick.

arthurvr avatar May 29 '15 15:05 arthurvr

same issue with 0.11.1, 0.11.0 and 0.10.0 installed version 0.8.0 then had to do bower install and npm install (some errors in generator)

grunt serve is working now

gadieichhorn avatar Jun 06 '15 18:06 gadieichhorn

+1

tw-zz-rk avatar Jun 12 '15 01:06 tw-zz-rk

The question is: How to use this generator with this problem? Just press enter until it end? Or the generator is abandoned? @eddiemonge

murilolobato avatar Jun 14 '15 22:06 murilolobato