north / generator-style-prototype

Yeoman Generator for Style Prototypes
362 stars 49 forks source link

Error in Grunt after initialising #56

Closed robhrt7 closed 10 years ago

robhrt7 commented 10 years ago

After initialising with yo, Grunt gives an error on all tasks

operatino:vasja operatino$ grunt server
Loading "Gruntfile.js" tasks...ERROR
>> TypeError: Cannot call method 'forEach' of undefined
Warning: Task "server" not found. Use --force to continue.

Aborted due to warnings.
danlucas commented 10 years ago

I've had this happen to me as well, though it's not exactly the same error. In my case it happens right after I run git init.

$ yo style-prototype

[?] The name of your client. (Required) test
[?] The client's URL. (Required) localhost
[?] The author of the Style Prototype. (Required) danlucas
[?] The email address of the author. (Required) xxx@xxx.xxx

(generator runs without error)

$ cd test
$ grunt server --launch

(installs gems, starts server, and launches browser no problem)

^c
$ git init
$ grunt server

Loading "Gruntfile.js" tasks...ERROR
>> TypeError: Cannot read property 'url' of undefined
Warning: Task "server" not found. Use --force to continue.

Aborted due to warnings.

If you remove git via rm -rf .git, you can run grunt server again without any issues. Obviously not the best solution.

Edit: Discovered that my error is due to the Gruntfile.js requiring an remote upstream repository on line 139

var gitURL = git['remote "' + userConfig.git.deployUpstream + '"'].url;

set a remote and grunt server runs without issue.

Snugug commented 10 years ago

We've moved away from the underlying technologies that caused this. If it persists in 2.0, please open a new issue.