Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grunt serve on vagrant box not showing

Running "grunt serve" on a VM shows no errors and according to command line dialogue appears to be serving as expected on 0.0.0.0:9000/#/ except that no browser (chrome) page is ever opened, and navigating to that address shows a 'Could not connect to 0.0.0.0:9000" error page.

Days of searching for a fix have been fruitless, any help would be greatly appreciated.

I am running an Ubuntu Precise32 box with Vagrant and provisioning via Puppet to support development using Laravel 4 + AngularJS. Installed packages include:

php apache composer mysql phpmyadmin ruby nodejs sass compass yeoman generator-angular

like image 210
Nolan Lawrence Avatar asked May 09 '14 06:05

Nolan Lawrence


2 Answers

Have you configured forwarding port 9000 in Vagrantfile?

config.vm.network :forwarded_port, guest: 9000, host: 9000 config.vm.network :forwarded_port, guest: 35729, host: 35729

The first one is for grunt serve and the second forwarding is for live-reload in Grunt.

like image 72
GianArb Avatar answered Oct 16 '22 01:10

GianArb


I had the same error as hiwaylon commented on accepted answer. What solved for me was running:

 sed -i 's/localhost/0.0.0.0/' Gruntfile.js

before "grunt serve"

like image 35
poswar Avatar answered Oct 16 '22 02:10

poswar