Tailwind Setup on Windows

Hi All,

I wanted to share a quick post about an issue I ran into setting up Tailwind in the latest version of Redwood (v0.21.0) on Windows.

Here are the steps and issue (with solution) that I ran into. I was using the Terminal built into VSCode.

  1. Ran the command “yarn rw setup tailwind”

  2. Terminal returned the following error during the Tailwind Init step:
    “‘mv’ is not recognized as an internal or external command”

  3. I decided to see what would happen even though the setup failed and ran “yarn rw dev”

  4. App wouldn’t load and got a post-css error saying the tailwind.config.js file wasn’t found in the “web” directory.

  5. I did have a tailwind.config.js file in the root of the app and this shed light on the “mv” not recognized error.

MV is a mac specific command and I’m pretty sure the RW setup command was attempting to move the tailwind.config file out of the root of the app into the web directory of the app.

SOLUTION

  1. Manually move the tailwind.config file into the web directory

  2. import the Tailwind CSS files into the app. In my case I added import ‘tailwindcss/tailwind.css’ into my web/src/index.js file

Hope this helps any other Windows users out there. Thanks for an amazing framework and community!

Neal

1 Like

What console application do you host in your VSCode terminal? mv is a very basic and fundamental unix program and should be available in both GitBash and any WSL environment. It’s also available in PowerShell. Which only leaves Cmd.

If you run your stuff straight on Windows (not WSL) I highly recommend you use the GitBash environment. Either in their own MinTTY console or using something like Widows Terminal, Cmder or ConEmu

1 Like

Thanks @Tobbe! I was using Powershell within VS Code. I also tried Powershell from Windows Terminal but had the same issue. I downloaded Git Bash and that did the trick, will use that going forward.

3 Likes

@Tobbe do you think it’s worth creating a GitHub Issue to try an improve this?

Totally. `yarn rw setup tailwind` depends on `mv`, which isn't always available · Issue #1557 · redwoodjs/redwood · GitHub

I will not spend any time on actually fixing it right now though. There’s an easy enough workaround available and I want to see if we get more reports like these to choose the best way forward.

(That said, if anyone else want to tackle this issue right now that would be awesome!)

3 Likes

Forgot to say, but a fix for this has been merged. If you’re on latest canary it should work out of the box now.