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

Receive Error at end of installation

Open mikeerickson opened this issue 13 years ago • 17 comments

/usr/local/lib/node_modules/generator-karma/node_modules/yeoman-generator/lib/util/common.js:5 '\n `---------´ | ' + 'Welcome to Yeoman,'.yellow.bold + ' |' + ^ TypeError: Cannot read property 'bold' of undefined at Object. (/usr/local/lib/node_modules/generator-karma/node_modules/yeoman-generator/lib/util/common.js:5:56) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/usr/local/lib/node_modules/generator-karma/node_modules/yeoman-generator/lib/base.js:91:26) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10)

mikeerickson avatar Aug 24 '13 21:08 mikeerickson

npm cache clean && npm update -g generator-angular

kevva avatar Aug 24 '13 21:08 kevva

I did that and still get the same error.

demetriusnunes avatar Aug 25 '13 03:08 demetriusnunes

@kevva This fix worked for me with the webapp generator yeoman/generator-webapp#137

Any ideas why similar procedure isn't working here? (same TypeError: Cannot read property 'bold' ... is being thrown after reinstall)

eckdanny avatar Aug 26 '13 19:08 eckdanny

Scratch that last comment!

Don't know if i was simply running commands in wrong order or if had to do with firing up a fresh terminal window. Working just fine now. :) I did what was previously suggested more or less and am happily generating stuff again

npm uninstall -g generator-angular generator-webapp yeoman-generator
npm cache clean
npm install -g generator-angular generator-webapp

update: I thought i was loosing my mind when this broke again for me just now. Then I invoked yo from existing and fresh terminal session and saw the versions didn't equate. I'm not sure how/where/why... I'm using homebrew on os X 10.8.4 if that helps. screen shot 2013-08-26 at 2 44 54 pm

eckdanny avatar Aug 26 '13 19:08 eckdanny

@mikeerickson As it says here

/usr/local/lib/node_modules/generator-karma/node_modules/yeoman-generator/lib/util/common.js:5

that issue was caused from karma, updating karma will fix for you. I did :

 npm cache clean && npm uninstall -g generator-karma && npm install -g generator-karma

and it was fixed.

raxityo avatar Aug 26 '13 19:08 raxityo

@eckdanny Good to hear. :)

btford avatar Aug 26 '13 20:08 btford

I am still getting this issue. If I create a new angular project with yeoman I keep getting the error "TypeError: Cannot read property 'bold' of undefined". What is strange is that one time I did not get the error out of 6 times trying. I had the same issue with webapp but I now have that working based on the suggestions of people on issue #137 of webapp. I think this issue comes from "generator-karma/node_modules/yeoman-generator/lib/util/common.js:5:56".

poeticninja avatar Aug 28 '13 14:08 poeticninja

@poeticninja : Updating karma will fix for you. do :

 npm cache clean && npm uninstall -g generator-karma && npm install -g generator-karma

raxityo avatar Aug 28 '13 14:08 raxityo

@geekrax I have done that. And I just did it again to make sure I did it properly but it still does not work.

poeticninja avatar Aug 28 '13 14:08 poeticninja

@poeticninja This has been driving me nuts too. (#337)

What finally worked for me, was installing generator-karma in local node_modules. (as opposed to global install)

eckdanny avatar Aug 28 '13 18:08 eckdanny

@eckdanny Thanks, I will have to try that and see if it works for me.

poeticninja avatar Aug 28 '13 21:08 poeticninja

I'm having the same problems. Tried cleaning npm cache, reinstalled generator-karma/angular/, updated yeoman. Any news?

ljupcospeci avatar Sep 03 '13 08:09 ljupcospeci

Any update on this? I have tried repeatedly to clean the cache, uninstall, re-install and the issue persists. Thank you.

nolandubeau avatar Sep 04 '13 01:09 nolandubeau

There's nothing we can do on our side. It's some layer of caching that causes those problems for you. You either have an old generator-angular or generator-karma locally or globally installed.

passy avatar Sep 11 '13 09:09 passy

For me, npm cache clean && npm uninstall -g generator-karma && npm install -g generator-karma worked fine! Thanks for the fix.

MaximeBernard avatar Sep 20 '13 09:09 MaximeBernard

Thank you. I didn't have karma installed at all. After looking at the above fix, I did install karma and then installed generator-angular and voila, it worked.

adityasaxena avatar Nov 05 '13 19:11 adityasaxena

I had the same problem as in most of the comments, I did all the above procedures and no answer fixed the problem so I tried to solve it after doing global uninstall for angular: npm uninstall -g generator-angular but I still see angular in the list of available generators when I run yo --help so I thought to do it locally npm uninstall generator-angular and that was the reason why it still showed the error before, I did the global installation again and the issue is fixed, hope this may help!!!

yabasha avatar Nov 16 '13 13:11 yabasha