Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tse.samson's avatar

Windows 10: 'spark' is not recognized as an internal or external command,....

Have anyone ran into the following issue with spark installation?

I installed all the requirements as per the documentation in Windows 10 environment. However, I still can't seem to get spark command to run. In the command prompt, it keeps showing the following message even if I'm in the directory with the executable file:

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

It's a new laptop, I installed xampp, composer, laravel, node.js &npm. Then download the spark installer from github and did 'composer install' from the 'spark-installer' directory.

Any help would be appreciated. Thanks!

0 likes
5 replies
willbrowning's avatar

You need to add 'spark' to your $PATH variable, in the docs it says:

Next, make sure the spark-installer directory is added to your systems >$PATH variable, so that your machine will be able to locate the spark >executable when you issue Spark commands.

Windows 10

  • In Search, search for and then select: System (Control Panel)
  • Click the Advanced system settings link.
  • Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
  • In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
  • Reopen Command prompt window, and run spark code.
tse.samson's avatar

I did that but it is still showing the same thing. The problem is that the executable won't execute even if I'm in that directory calling it. It's strange.

chriswb's avatar

I'm having this same issue. I've ensured that the directory is in the system PATH already.

When I go to the actual directory and run spark is still says the same thing.

Did you get this sorted @tse.samson ?

Chris

Cronix's avatar

The spark docs clearly state not to use the spark-installer if on windows, and to use the composer install method.

Note: The Spark installer is only recommended for those on Mac or Linux systems. If you are using Windows, please install via Composer. Before using the Spark installer, make sure you have installed the Laravel installer.

https://spark.laravel.com/docs/4.0/installation#spark-installer

chriswb's avatar

I went with Homestead instead but thanks for the response - i was maybe a little eager and missed that note :)

Please or to participate in this conversation.