yeoman / generator-angular

Yeoman generator for AngularJS
http://yeoman.io
5.73k stars 1.44k forks source link

Yo angular dist problems #1222

Open addyosmani opened 8 years ago

addyosmani commented 8 years ago

From @roestigraben on November 30, 2015 11:22

Hello, I have a problem with yeoman to build the distribution version of myApp first are some info about my system/install

OSX 10.10.5 bower : 1.6.8 npm: 3.5.0 yo: 1.5.0

To scaffold my App, I do run the command with the options yo angular myApp Gulp? no Sass? no Bootstrap? yes angular-animate? no angular-aria? no angular-cookies? no angular-resources? no angular-route? yes angular-sanitize? no angular-touch? no

the build process runs OK with the following issue only UNMET PEER DEPENDENCY jasmine-core@* ├── UNMET PEER DEPENDENCY karma@^0.13.0 || >= 0.14.0-rc.0 ├── karma-jasmine@0.3.6 ├─┬ karma-phantomjs-launcher@0.2.1 │ └── lodash@3.10.1 └── UNMET PEER DEPENDENCY phantomjs@>=1.9

when I start the grunt serve, everything is OK

the doing grunt to get the dist be built, iI get aborted as per Running "connect:test" (connect) task Started connect web server on http://localhost:9001 Loading "grunt-karma.js" tasks...ERROR

Error: Cannot find module 'karma' Warning: Task "karma" failed. Use --force to continue.

Aborted due to warnings.

When I do grunt --force I get it done but I get

Warning: Running "imagemin:dist" (imagemin) task Fatal error: Cannot read property 'contents' of undefined

Execution Time (2015-11-30 11:17:49 UTC)
loading tasks                   391ms  ▇▇▇▇▇▇▇▇▇▇ 32%
loading grunt-contrib-imagemin  478ms  ▇▇▇▇▇▇▇▇▇▇▇▇ 39%
imagemin:dist                   354ms  ▇▇▇▇▇▇▇▇▇ 29%
Total 1.2s Used --force, continuing.

Running "imagemin:dist" (imagemin) task
Fatal error: Cannot read property 'contents' of undefined

Can someone help me to get thisresolved please many thanks Peter

Copied from original issue: yeoman/yeoman#1572

eddiemonge commented 8 years ago

Yup its the peerDeps problem. generator-karma should be fixed as well as this. Updating this is still on my roadmap. After I finish the generator list, I'll try to get back to this.

edorgeville commented 8 years ago

:+1:

gunish commented 8 years ago

Is there a workaround for this at the moment ?

eddiemonge commented 8 years ago

Manually install the peerdependencies

vshanbha commented 8 years ago

I get the same error when I do grunt build

commands followed : yo angular Gulp ? no Sass ? no Bootstrap ? Yes

After scaffolding was created ran grunt build and same error I tried manually installing the peer dependencies. Even after that I am getting the same error.

Any suggestions on how to get around this

vshanbha commented 8 years ago

Found this related issue. https://github.com/gruntjs/grunt-contrib-imagemin/issues/330 Installing grunt-contrib-imagemin Downgrade to 0.9.1 is working grunt build worked for me with this little change

ryanburnett commented 8 years ago

cd into your project root and run:

npm cache clean && npm install grunt-contrib-imagemin

roestigraben commented 8 years ago

Thanks a lot !!!

ghost commented 8 years ago

Still, this is annoying. When is this going to be fixed?

mbejda commented 8 years ago

I had simply commented out the Karma from the grunt file build. Karma should be PRE or POST part of the build process and not part of the build process. Karma constantly breaking is an unnecessary headache.

softmonkeyjapan commented 8 years ago

Same here. I had downgrade grunt-contrib-imagemin, change images permissions, make sure files are not corrupred, rebuild with npm cache clean && npm install && bower install but still getting the error.

Note that on my end, I didn't change a thing on my app except a HTML link. It was working fine before. Still trying to figure a workaround...

softmonkeyjapan commented 8 years ago

Ok fixed it with

npm cache clean && npm install gruntjs/grunt-contrib-imagemin

I have an old app using previous version of yo and angular. I recently installed a fresh install of yo and generator-angular for a new project. Since, I could not grunt build again.

Simpler1 commented 8 years ago

@vshanbha Thanks. Downgrading grunt-contrib-imagemin to 0.9.1 worked.

npm install grunt-contrib-imagemin@0.9.1 --save-dev