Laravel Homestead rm’ is not recognized as an internal or external command

If you see this error when working on Windows 10 with composer or another .bat file of sorts setting up Laravel Homestead:

'rm' is not recognized as an internal or external command, operable program or batch file.”

this means it was run from a non Linux friendly location so from outside the Vagrant box. On you Windows box directly so to speak.

These Linux commands like rm are available inside the Vagrant box the command or in a Linux kind of environment. So you could

  1. ssh into the box and run the bash file and or other commands requiring Linux commands https://laravel.com/docs/8.x/homestead#connecting-via-ssh
  2. install the Linux subsystem WSL if you want to run Linux commands from the Windows Power shell even when not inside the VM.

This command will then run without issues. I recommend adding WSL as it will allow you to move part of the Linux world and its handy commands into you Windows world and make your development life much easier.

Jasper Frumau

Jasper has been working with web frameworks and applications such as Laravel, Magento and his favorite CMS WordPress including Roots Trellis and Sage for more than a decade. He helps customers with web design and online marketing. Services provided are web design, ecommerce, SEO, content marketing. When Jasper is not coding, marketing a website, reading about the web or dreaming the internet of things he plays with his son, travels or run a few blocks.