Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator throws error during scaffolding #20

Closed
bchu opened this issue May 26, 2013 · 18 comments
Closed

Generator throws error during scaffolding #20

bchu opened this issue May 26, 2013 · 18 comments

Comments

@bchu
Copy link

bchu commented May 26, 2013

The generator throws an error mid-way through scaffolding an angular app, then continues on. I'm not sure if that's supposed to happen, and I'm not sure whether that has anything to do with the lack of e2e tests in the resulting app.

yo angular --minsafe
.... (some stuff)
   invoke   karma:app
   create     karma.conf.js
   create     karma-e2e.conf.js

events.js:130
    throw TypeError('listener must be a function');
          ^
TypeError: listener must be a function
    at TypeError (<anonymous>)
    at ChildProcess.EventEmitter.addListener (events.js:130:11)
    at runInstall (/Users/brian/.nvm/v0.10.8/lib/node_modules/generator-karma/node_modules/yeoman-generator/lib/actions/install.js:63:6)
    at KarmaGenerator.install [as npmInstall] (/Users/brian/.nvm/v0.10.8/lib/node_modules/generator-karma/node_modules/yeoman-generator/lib/actions/install.js:153:10)
    at KarmaGenerator.<anonymous> (/Users/brian/.nvm/v0.10.8/lib/node_modules/generator-karma/lib/generators/app/index.js:20:12)
    at KarmaGenerator.EventEmitter.emit (events.js:117:20)
    at /Users/brian/.nvm/v0.10.8/lib/node_modules/generator-karma/node_modules/yeoman-generator/lib/base.js:306:14
    at process._tickCallback (node.js:415:13)
@passy
Copy link
Member

passy commented May 26, 2013

Some of your dependencies are outdated. Can you try a fresh install?

@bchu
Copy link
Author

bchu commented May 26, 2013

I tried a fresh install with:

node v0.8.23, then running npm -g update npm, then npm -g install yo grunt-cli bower, then npm -g install generator-angular, then yo angular. The same error emerges.

Also tried
node v0.10.8, then npm -g install yo grunt-cli bower, then npm -g install generator-angular, then yo angular, and the same result. Same for when I directly try yo karma.

@oori
Copy link

oori commented May 27, 2013

same issue here on node v0.10.8
but, it does work on v0.8.15

@passy
Copy link
Member

passy commented May 27, 2013

This is a bug we fixed before, so it must be some stale dependency. Did you run npm cache clean before reinstalling?

@oori
Copy link

oori commented May 27, 2013

Yes, it did the trick. npm cache clean. (just in case,uninstalled them before..)
Thanks!

@passy
Copy link
Member

passy commented May 27, 2013

@bchu Does this work for you, too?

@bchu
Copy link
Author

bchu commented May 28, 2013

Very weird. I was running npm cache clean before and it didn't work. But for some reason it is working now. It would seem that it can be important when (at what stage) you run npm cache clean.

But it works now.

@bchu bchu closed this as completed May 28, 2013
@eddiemonge
Copy link
Member

at what stage is the correct place to run it? i installed node and npm fresh along with yo, grunt-cli and bower and am getting this on a fresh checkout

@bsphere
Copy link

bsphere commented Jun 27, 2013

I'm also getting this issue after npm cache clean and fresh install of yo bower grunt-cli and generator-angular

events.js:130
    throw TypeError('listener must be a function');
          ^
TypeError: listener must be a function
    at TypeError (<anonymous>)
    at ChildProcess.EventEmitter.addListener (events.js:130:11)
    at runInstall (/usr/lib/node_modules/generator-karma/node_modules/yeoman-generator/lib/actions/install.js:63:6)
    at KarmaGenerator.install [as npmInstall] (/usr/lib/node_modules/generator-karma/node_modules/yeoman-generator/lib/actions/install.js:153:10)
    at KarmaGenerator.<anonymous> (/usr/lib/node_modules/generator-karma/lib/generators/app/index.js:20:12)
    at KarmaGenerator.EventEmitter.emit (events.js:117:20)
    at /usr/lib/node_modules/generator-karma/node_modules/yeoman-generator/lib/base.js:306:14
    at process._tickCallback (node.js:415:13)

@wannado
Copy link

wannado commented Jun 27, 2013

same here the whole day wasted... cleaned all cache and reinstalled eveything just wont work.

events.js:130
throw TypeError('listener must be a function');
^

@bchu
Copy link
Author

bchu commented Jun 27, 2013

Try uninstalling the generators and yo/grunt/bower, then npm cache clean, then install yo/grunt/cli, then npm cache clean, then install generator-, then npm cache clean, then yo <whatever>

@bsphere
Copy link

bsphere commented Jun 27, 2013

doesn't help.. same problem

@sindresorhus
Copy link
Member

@passy @btford

@sindresorhus sindresorhus reopened this Jun 29, 2013
@passy
Copy link
Member

passy commented Jun 29, 2013

This was fixed with the v0.3.1 release of generator-karma yesterday.

@passy passy closed this as completed Jun 29, 2013
@islandmanllc
Copy link

I've spent 3 hours trying to get this to work but still get the same error.

I've tried with Node 0.8.15, 0.8.25, 0.10.15
npm install -g yo grunt-cli bower
npm install -g angular

events.js:130
throw TypeError('listener must be a function');
^
TypeError: listener must be a function
at TypeError ()
at ChildProcess.EventEmitter.addListener (events.js:130:11)
at runInstall (C:\node_modules\generator-karma\node_modules\yeoman-generator\lib\actions\install.j
at KarmaGenerator.install [as npmInstall] (C:\node_modules\generator-karma\node_modules\yeoman-gen
at KarmaGenerator. (C:\node_modules\generator-karma\lib\generators\app\index.js:20:12)
at KarmaGenerator.EventEmitter.emit (events.js:117:20)
at C:\node_modules\generator-karma\node_modules\yeoman-generator\lib\base.js:306:14
at process._tickCallback (node.js:415:13)

I'm about to give up on this because it's quickly becoming very costly. Can anyone please list a valid configuration?

Node version and 32/64 bit?
Installation instructions 1...n including the need for clearing cache

Thanks,

@btford
Copy link
Contributor

btford commented Aug 3, 2013

what versions of the generators?

@islandmanllc
Copy link

angular: 0.3.0
karma: 0.4.1

@islandmanllc
Copy link

correction:
angular: 0.3.1
karma: 0.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants