wesleytodd / YeoPress

A Yeoman generator for WordPress
Other
1.08k stars 163 forks source link

TypeError: Cannot call method 'directory' of undefined on windows #119

Closed ryan-wong closed 9 years ago

ryan-wong commented 9 years ago

My configuration is below. I keep getting this error on windows.

WordPress URL: http://localhost/yeomanwordpress Table prefix: wp_ Database host: localhost Database name: yeomandb Database user: root Database password: Use Git? Yes Would you like to install WordPress as a submodule? Yes WordPress install directory: cms WordPress content directory: content Install a custom theme? Yes Destination directory: yeopress Theme source type (git/tar) git GitHub username: ryan-wong GitHub repository name: YeoPress Repository branch: template Does this all look correct? Yes

info ... Fetching http://github.com/ryan-wong/YeoPress/archive/template.tar.gz ...
info This might take a few moments
C:\Users\Deluxe2\AppData\Roaming\npm\node_modules\generator-wordpress\util\wordpress.js:241
remote.directory('.', path.join(config.contentDir, 'themes', config.themeDi
TypeError: Cannot call method 'directory' of undefined    at C:\Users\Deluxe2\AppData\Roaming\npm\node_modules\generator-wordpress\util\wordpress.js:241:11
    at Transform.done (C:\Users\Deluxe2\AppData\Roaming\npm\node_modules\generat
or-wordpress\node_modules\yeoman-generator\lib\actions\actions.js:425:14)
    at Transform.emit (events.js:95:17)
    at Request.<anonymous> (C:\Users\Deluxe2\AppData\Roaming\npm\node_modules\ge
nerator-wordpress\node_modules\yeoman-generator\node_modules\download\index.js:6
4:24)
    at Request.emit (events.js:95:17)
    at Request.onResponse (C:\Users\Deluxe2\AppData\Roaming\npm\node_modules\gen
erator-wordpress\node_modules\yeoman-generator\node_modules\download\node_module
s\request\request.js:1100:10)
    at ClientRequest.g (events.js:180:16)
    at ClientRequest.emit (events.js:95:17)
    at HTTPParser.parserOnIncomingClient [as onIncoming](http.js:1692:21)
    at HTTPParser.parserOnHeadersComplete [as onHeadersComplete](http.js:121:23)
TommySorensen commented 9 years ago

I got the same error today when saying yes to github. If you say no to git/github it all works

mitramejia commented 9 years ago

I'm having the same error on ubuntu 14.04 as well

wesleytodd commented 9 years ago

Anyone who is having this issue found a fix? I have not been using the generator lately and have not had time to check this out. I would happily accept a pull request to fix this.

lukeggchapman commented 9 years ago

I found that this happened only when installing a custom template. I'm assuming its looking for a repo for it and doesn't find it.

Toddses commented 9 years ago

Looked into this a little bit. Luke hit the nail on the head, this happens when you pull in a custom theme from a repo that doesn't exist. Probably can resolve this by adding some graceful error checking.

isaacalves commented 9 years ago

Got the same error on Mac OSX when choosing "Install a custom theme" on the initial configuration

0vermind commented 9 years ago

Same error without using git or custom theme or anything else.... Unusable.

wesleytodd commented 9 years ago

@0vermind can you post your settings and the error message?

wesleytodd commented 9 years ago

See: #148. This is what happens with the download fails. We just need to log helpful errors there.

wesleytodd commented 9 years ago

Fixed in #148