mattbtay
mattbtay

Reputation: 135

Running Grunt, Unable to connect to localhost

I am running a yeoman app when I run the server everything passes, but I get this odd port for the server,

Matt-MacbookPro:places mattbtay$ grunt serve
Running "serve" task

Running "clean:server" (clean) task
Cleaning .tmp...OK

Running "concurrent:server" (concurrent) task

Running "copy:styles" (copy) task


Done, without errors.

Running "compass:server" (compass) task
directory .tmp/styles/ 
   create .tmp/styles/main.css (7.533s)
Compilation took 7.536s

Done, without errors.

Running "autoprefixer:dist" (autoprefixer) task
Prefixed file ".tmp/styles/main.css" created.

Running "connect:livereload" (connect) task
Started connect web server on ::1:9000.

Running "watch" task
Waiting...

I would normally just want to load "localhost:9000" and the server would run find. But as it currently is, I have to enter that manually, is there something I have changed on my system that would be connecting to ::1:9000?

Upvotes: 0

Views: 1628

Answers (1)

vucalur
vucalur

Reputation: 6087

Actually ::1 is not a port, it's an IPv6 localhost address.
Looks like your Grunt tries to use IPv6, perhabs your system is confgiured to prefer IPv6.

Run $ ifconfig and make sure that IPv4 line is present on lo interface: inet addr:127.0.0.1 Mask:255.0.0.0.
If you can see only inet6 addr: ::1/128, when you simply don't have IPv4 enabled/configured.

No IPs should be hard-coded into Grunt configuration generated by Yeoman - it looks up the IP bound to localhost. Check out connect task configuration in https://github.com/yeoman/generator-angular/blob/master/templates/common/Gruntfile.js. You should have sth similar in your local Gruntfile.

Upvotes: 1

Related Questions