Roots Discourse

Gulp watch opens nginx welcome page & Install Dependencies with Composer error when running vagrant up

I had a personal project set up and had to do a system restore on my Mac and ended up restoring back to my origin Time Machine checkpoint. I went to go work on a project and ran ‘gulp watch’ and was faced with a 404 page. I ran ‘npm install’, ‘vagrant up’, and made sure everything was still in place but still no luck? Wondering what other things I might need to check up on to get this project up and going again. Haven’t messed with this configuration in over a year so I’m a little rusty. Thanks.

Strange, did you check your manifest.json at the bottom to see what link gulp watch is proxying? And try to load that link it directly? If you also get a 404 it’s probably WP related rather then Sage/gulp. So the next thing would be to probably check the WP backend for which page it is loading as front page etc. Maybe it’s missing some templates now?

Also to reset some things you can delete the node_modules folder, run npm install, bower install, first gulp and then gulp watch to “clean things up”.

But as said 404 seems to be WP related and not really Sage/gulp.

1 Like

Yea they’re both proxying the same link and I get the same 404 when trying to load that link. I went ahead and tried deleting node_modules and reinstalling but still no luck.

I’m wondering if it has something to do with my VM? I think you’re right though, doesn’t seem like a Sage/gulp issue. I’d really appreciate it if anyone can point me in the right direction for fixing VM or WP issues because I have no idea what I’m looking for… :sweat: I’m trying to figure out what settings or folders or something could be wiped out when reverting to a previous Time Machine checkpoint. I even made sure to commit everything to Git right before doing the revert.

I ran vagrant provision and got this:

Composer could not find a composer.json file in /srv/www/corey.dev/current To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section

Have to leave for work now, but at least I’m getting some sort of error I can look into later.

I found this online https://imagewize.com/web-development/roots-trellis-errors/.

Is running vagrant destroy & vagrant up a common solution to problems. Sorry for the newb-ish question, just don’t want to dig myself into a deeper hole. It just sounds like it’s destroying my current VM and rebuilding it, right?

I’m going to try this along with a nginx restart if necessary.

Tried vagrant destroy and vagrant up and was faced with an error at the ‘Install Dependencies with Composer’ step. When i run gulp watch on my theme I’m taken to the nginx welcome page. Going to my devUrl brings me to the same place too. I ran composer.phar install on my theme to make sure composer was still installed and it attempted to update without any errors, not sure where to go from here?

What error?

The server didn’t finish provisioning successfully.

Try re-provisioning the box and note any errors.

Thanks, I ran composer.phar require roots/soil 3.5.0 in my themes directory and did another vagrant destroy and a vagrant provision followed by vagrant up

FWIW you should be requiring Soil at the Bedrock root level with the composer.json file there, not the themes directory.

Also, after a vagrant destroy you don’t need to do vagrant provision, you can just do vagrant up since it runs the provisioning during the first up.

Sorry, not sure why I wrote themes dir. It was my site directory.