Reputation: 157
I've spent 13 hours to compose Laravel Sail and I hadn't able to install it on Windows 10 operating system. But later fortunately my collegaue found the solution when he also bumbed into this error message:
Unsupported operating system [MINGW64_NT-10.0-19042]. Laravel Sail supports macOS, Linux, and Windows (WSL2).
During the 13 hours:
/vendor/
folder in my project and ran composer udpate
based on this answer: https://stackoverflow.com/a/65513584/10473070 Also didn't work.The solution and partial explanations are in my answer.
Upvotes: 1
Views: 1615
Reputation: 157
The solution is in Sail and the issue is a kind of bug.
But first the prepare steps:
sail
file in the vendor folder: vendor/laravel/sail/bin/sail
and change from this code:
Verify operating system is supported...
case "${UNAMEOUT}" in
Linux*) MACHINE=linux;;
Darwin*) MACHINE=mac;;
*) MACHINE="UNKNOWN"
esac
if [ "$MACHINE" == "UNKNOWN" ]; then
echo "Unsupported operating system [$(uname -s)]. Laravel Sail supports macOS, Linux, and Windows (WSL2)." >&2
exit 1
fi
to this:
# Verify operating system is supported...
#case "${UNAMEOUT}" in
# Linux*) MACHINE=linux;;
# Darwin*) MACHINE=mac;;
# *) MACHINE="UNKNOWN"
#esac
#
#if [ "$MACHINE" == "UNKNOWN" ]; then
# echo "Unsupported operating system [$(uname -s)]. Laravel Sail supports macOS, Linux, and Windows (WSL2)." >&2
#
# exit 1
#fi
This solve the problem.
And why can we do this?
Because to check the vendor/laravel/sail/bin/sail
bash file you can notice that every command can run in bash and terminal on Windows also without any problem.
Maybe they forget to put a Windows checking line in this code segment above.
To do these process Laravel Sail works like a charm based on Laravel Sail documentation.
And don't forget that this is just a hotfix because the next Sail update will override the modified sail bash file!
Upvotes: 2