404 Not found error when tring to access local.wordpress.dev

1.4k Views Asked by At

I'm trying to setup Varying Vagrant Vagrants on a Windows machine for WordPress development.

I'm running Windows 8.1 Pro 64-bit OS and installed Virtual Box 5.0 and Vagrant 1.8.1.

After executing the line vagrant up --provision in Command Prompt, I'm getting the following errors and then when tried to access local.wordpress.dev, 404 Not Found is displayed.

==> default: Initializing grunt in WordPress develop... This may take a few mome
nts.
==> default: >> Local Npm module "grunt-browserify" not found. Is it installed?
==> default: Loading "sass.js" tasks...
==> default: ERROR
==> default: >> Error: The `libsass` binding was not found in /srv/www/wordpress
-develop/node_modules/node-sass/vendor/linux-x64-11/binding.node
==> default: >> This usually happens because your node version has changed.
==> default: >> Run `npm rebuild node-sass` to build the binding for your curren
t node version.
==> default: Running "clean:all" (clean) task
==> default: >> 0 paths cleaned.
==> default: Running "copy:files" (copy) task
==> default: Created 142 directories
==> default: , copied 1247 files
==> default: Running "copy:wp-admin-css-compat-rtl" (copy) task
==> default: Copied 1 file
==> default: Running "copy:wp-admin-css-compat-min" (copy) task
==> default: Copied 2 files
==> default: Running "copy:version" (copy) task
==> default: Copied 1 file
==> default: Running "cssmin:core" (cssmin) task
==> default: >> 36 files created. 634.73 kB → 535.78 kB
==> default: Warning: Task "sass:colors" not found. Use --force to continue.
==> default: Aborted due to warnings.
==> default:
==> default: VVV custom site import
==> default: Cleaning the virtual machine's /etc/hosts file...
==> default: Adding domains to the virtual machine's /etc/hosts file...
==> default:  * Added vvv.dev from /srv/www/vvv-hosts
==> default:  * Added local.wordpress.dev from /srv/www/vvv-hosts
==> default:  * Added local.wordpress-trunk.dev from /srv/www/vvv-hosts
==> default:  * Added src.wordpress-develop.dev from /srv/www/vvv-hosts
==> default:  * Added build.wordpress-develop.dev from /srv/www/vvv-hosts
==> default: -----------------------------
==> default: Provisioning complete in 2911 seconds
==> default: For further setup instructions, visit http://vvv.dev
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: mysql stop/waiting
==> default: mysql start/running, process 28333
==> default: Running provisioner: shell...
    default: Running: inline script
==> default:  * Restarting nginx nginx
==> default:    ...done.

Please note: I manually modified the hosts file with the following

192.168.50.4 vvv.dev local.wordpress.dev local.wordpress-trunk.dev src.wordpress-develop.dev build.wordpress-develop.dev

This issue has already been reported on VVV GitHub page.

Is there anything related to Windows that causes the above error and giving a 404? I'm totally new to Vagrant and VVV and your help would be very much appreciated.

2

There are 2 best solutions below

0
On BEST ANSWER

Finally, I resolved the issue that I reported.

Windows users must use vagrant up --provision and this solved the issue. Ensure to run the command prompt as Administrator.

Similar issue was reported in GitHub and resolved this way.

Update: If you have WampServer or Xampp installed, un-install it before installing VVV.

3
On

I can't say for sure the issue is NOT related to your host (Windows), as it's not clear how the box is being booted. I also haven't used VVV in a while. However, it does not appear your host has anything to do with the issue.

For the purposes of troubleshooting, there are really two issues here, which may or may not be related.

  1. The errors indicated in your question come from grunt, a node/npm package on the guest (the operating system inside the virtual machine) being unable to load the packages it needs.

  2. The webserver (which is working, since it's returning a 404) is not serving the file you expected.

I believe your problem stems from grunt not being able to run all the tasks needed to prepare your server, although it is unclear as to why. If you are comfortable with the commandline, you can ssh into the guest and try running the grunt tasks manually and installing any packages that may be missing.

To do this, you need to find your way into the directory containing the Gruntfile.js and package.json files. From there, run

npm install

and hopefully all the packages will install correctly. If you reboot the guest, everything should work. If the packages did not install correctly, at least you should have a better idea of what is going wrong.