redwood: tailwind generator fails on Windows 10

With a new installation of Redwood 0.19.1 yarn rw g util tailwind fails to execute on Windows 10 using PowerShell. Also tested with same result using Git Bash.

Output

PS C:\Users\nerdstep\webdev\shipu> yarn rw g util tailwind
yarn run v1.22.5
$ C:\Users\nerdstep\webdev\shipu\node_modules\.bin\rw g util tailwind
rw g util <util>

Quality of life utilities

Options:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]

Also see the Redwood CLI Reference
(​https://redwoodjs.com/reference/command-line-interface​)

Not enough non-option arguments: got 0, need at least 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

System info

System:
    OS: Windows 10 10.0.19041
  Binaries:
    Node: 12.18.4 - ~\AppData\Local\Temp\yarn--1601065079101-0.9007915850264594\node.CMD
    Yarn: 1.22.5 - ~\AppData\Local\Temp\yarn--1601065079101-0.9007915850264594\yarn.CMD 
  Browsers:
    Edge: Spartan (44.19041.423.0), Chromium (85.0.564.63)
  npmPackages:
    @redwoodjs/core: ^0.19.1 => 0.19.1 

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 20 (20 by maintainers)

Most upvoted comments

So, apparently, Setup hasn’t been, ahem, setup?

This helps. Will dig deeper a bit later

As we saw in a previous comment of mine, installing 0.19.2-canary.40 doesn’t give me the setup command at all. Doing a build locally and copying that over (yarn rwt copy) does give me setup.

But running yarn rw setup tailwind fails with a message of a missing file, and I couldn’t figure out why. I run yarn rwt copy and the file is there. I run yarn rw setup tailwind and the file is not there 🤔

I finally figured out the file disappears because yarn rw setup tailwind does yarn workspace web add ... and that overwrites (removes) the stuff that yarn rwt copy copied to the node_modules folder. le sigh

So. This works:

$ yarn rwt copy
$ yarn workspace web add -D postcss-loader@4.0.2 tailwindcss autoprefixer@9.8.6
$ cp -r ../redwood/packages/cli/dist/commands/setu* node_modules/\@redwoodjs/cli/dist/commands/
$ vim node_modules/\@redwoodjs/cli/dist/commands/setup/tailwind/tailwind.js
      //await (0, _execa.default)('yarn', ['workspace', 'web', 'add', '-D', 'postcss-loader@4.0.2', 'tailwindcss', 'autoprefixer@9.8.6']);
$ yarn rw setup tailwind

I have a project that’s still on 0.15.4-canary.6 that I was just about to lift. Might as well go all the way to latest canary 🐦

Will report back later