Skip to content

tailwindcss: "Can't resolve 'tailwindcss'" error occurs when attempting to build CSS file #205505

@nint8835

Description

@nint8835

brew gist-logs <formula> link OR brew config AND brew doctor output

~/Development/issue-repro
❯ brew config
HOMEBREW_VERSION: 4.4.17
ORIGIN: https://github.com/Homebrew/brew
HEAD: 55f399c10dc7e6cc07497bdfccdecc96329e3b57
Last commit: 6 days ago
Branch: stable
Core tap JSON: 25 Jan 17:45 UTC
Core cask tap JSON: 25 Jan 17:45 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 3.3.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby
CPU: octa-core 64-bit arm_ibiza
Clang: 16.0.0 build 1600
Git: 2.39.5 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.2-arm64
CLT: 16.2.0.0.1.1733547573
Xcode: N/A
Rosetta 2: false

~/Development/issue-repro
❯ brew doctor
Your system is ready to brew.

Verification

What were you trying to do (and why)?

I am attempting to use the version of the Tailwind CLI available through Homebrew to bundle a CSS file for my project using Tailwind. Since upgrading to V4, this no longer works. It does, however, work through the latest release of the CLI downloaded from their GitHub

What happened (include all command output)?

❯ tailwindcss -i index.css -o output.css
Error: Can't resolve 'tailwindcss' in '/Users/nint8835/Development/issue-repro'

What did you expect to happen?

I expected the file to build successfully, as occurs with the version of the Tailwind CLI file I downloaded from the GitHub release (https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.0.0)

❯ ./tailwindcss-macos-arm64 -i index.css -o output.css
≈ tailwindcss v4.0.0

Done in 30ms

Step-by-step reproduction instructions (by running brew commands)

  • Create a new directory to perform repro in

  • Create an index.css containing the bare minimum to use Tailwind

    @import "tailwindcss";
  • Install Tailwind via brew (brew install tailwindcss)

  • Attempt to build your index.css (tailwindcss -i index.css -o output.css)

You should get the error Error: Can't resolve 'tailwindcss' in <current working directory>

You should not get an error, and output.css should be generated successfully

I have had another person test this and confirm they were able to reproduce the same

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream issueAn upstream issue report is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions