Skip to content

sm new project: missing @tailwindcss/cli dep, breaks SimpleModule.Hosting Tailwind build target #151

@antosubash

Description

@antosubash

Summary

sm new project (CLI v0.0.36) generates package.json with tailwindcss@^4.2.2 and @tailwindcss/vite@^4.2.2 as deps, but no @tailwindcss/cli. The Tailwind v4 packages no longer ship a standalone CLI in tailwindcss itself — the CLI binary is provided by @tailwindcss/cli. So after npm install, node_modules/.bin/tailwindcss does not exist.

SimpleModule.Hosting.targets then runs "\$(RepoRoot)node_modules/.bin/tailwindcss" -i ... -o ... --minify during dotnet build and fails:

SimpleModule.Hosting.targets(64,5): error MSB3073: The command "...node_modules/.bin/tailwindcss" -i ... exited with code 127.

Net effect: a freshly-scaffolded project doesn't compile until you manually npm install -D @tailwindcss/cli.

Repro

dotnet tool install -g SimpleModule.Cli   # 0.0.36
sm new project Repro
cd Repro
npm install   # (after working around #150 by removing @simplemodule/tsconfig)
dotnet build
# fails with MSB3073, exit code 127, missing tailwindcss bin

Expected

Build succeeds without manual dep additions. Either:

  1. Add @tailwindcss/cli to the template's package.json devDependencies (alongside @tailwindcss/vite).
  2. Switch the Tailwind build target to invoke npx tailwindcss … so npm resolves the binary regardless of which package provides it.
  3. Move the Tailwind CSS compilation into the Vite pipeline (@tailwindcss/vite plugin already does this) and remove the standalone tailwindcss CLI invocation from SimpleModule.Hosting.targets.

Option 1 is the smallest change. Option 3 is the cleanest long-term given that Tailwind v4 prefers the bundler-integrated path.

Workaround

Add to package.json devDependencies: "@tailwindcss/cli": "^4.2.2", then npm install.

Environment

  • sm --version: 0.0.36
  • dotnet --version: 10.0.201
  • tailwindcss installed: 4.2.4
  • @tailwindcss/cli available: yes (latest 4.2.4)

Related

#150 (also about npm-dep gaps in the template).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions