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

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

Open
coxrichuk opened this issue Dec 17, 2013 · 10 comments
Open

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

coxrichuk opened this issue Dec 17, 2013 · 10 comments

Comments

@coxrichuk
Copy link

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
Copy link

I have the same issue

@DeepAnchor
Copy link

+1 on this issue!

@adamdicarlo
Copy link

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
Copy link

zewa666 commented Jan 28, 2015

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
Copy link

adaam2 commented Feb 19, 2015

Any idea on how to fix?

@zewa666
Copy link

zewa666 commented Feb 19, 2015

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
Copy link
Member

@heldr would you be up for this rewrite?

@heldr
Copy link
Member

heldr commented Feb 25, 2015

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
Copy link
Member

heldr commented Feb 25, 2015

@zewa666
Copy link

zewa666 commented Feb 25, 2015

@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 :)

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

8 participants