jquery-boilerplate / generator-jquery-boilerplate

Yeoman Generator for jQuery Boilerplate
https://npmjs.org/generator-jquery-boilerplate
151 stars 31 forks source link

TypeError: Object [object Object] has no method 'sourceRoot' #6

Open coxrichuk opened 10 years ago

coxrichuk commented 10 years ago

I've installed the NPM packages, but when I then try and scaffold out the boilerplate with:

yo jquery-boilerplate

I am returned:

dev@server:~/www/jqueryboilerplate/pub $ yo jquery-boilerplate

 /usr/lib/node_modules/generator-jquery-boilerplate/app/index.js:7
 var files   = this.expandFiles('**/*', { cwd: this.sourceRoot(), dot: true }
                                                 ^
 TypeError: Object [object Object] has no method 'sourceRoot'
     at new module.exports (/usr/lib/node_modules/generator-jquery-    boilerplate/app/index.js:7:54)
 at Environment.create (/usr/lib/node_modules/yo/node_modules/yeoman-generator/lib/env/index.js:325:10)
at Environment.run (/usr/lib/node_modules/yo/node_modules/yeoman-generator/lib/env/index.js:361:24)
at init (/usr/lib/node_modules/yo/bin/yo:98:7)
at pre (/usr/lib/node_modules/yo/bin/yo:110:3)
at Object.<anonymous> (/usr/lib/node_modules/yo/bin/yo:135:1)
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)

I assume it has something to do with not being able to find the sourceRoot?

patrick91 commented 10 years ago

I have the same issue

DeepAnchor commented 10 years ago

+1 on this issue!

adamdicarlo commented 9 years ago

Just saw this on another generator (aurelia), only after upgrading yeoman (from 1.1.x to 1.4.5), so I'm guessing Yeoman changed its api recently and broke generators...? cc @addyosmani

zewa666 commented 9 years ago

Thanks for the hint, got the generator-aurelia updated. For you guys here this is the new syntax: http://yeoman.io/authoring/file-system.html

adaam2 commented 9 years ago

Any idea on how to fix?

zewa666 commented 9 years ago

Sadly the only way I see is to rewrite the generator to use the new API. Had to do it for mine as well :)

zenorocha commented 9 years ago

@heldr would you be up for this rewrite?

heldr commented 9 years ago

Currently I'm pretty busy through a company's project. It will take several weeks.

I will do my best. For now I am going to create a branch for this rewrite(community PRs will be handy).

heldr commented 9 years ago

https://github.com/jquery-boilerplate/generator-jquery-boilerplate/tree/0.2.0

zewa666 commented 9 years ago

@heldr oh since the generator is so small I thought contributing back a PR with the upgrade. Since you've already updated the package.json yo dependency only the fix for the index.js should be necessary to get it working. Please of course first try it out :)