Skip to content

tailwindcss.cmd missing from node_modules/.bin for v4.1.11 on Windows with npm exec #18463

@ashannavarathna

Description

@ashannavarathna

Title: tailwindcss.cmd missing from node_modules/.bin for v4.1.11 on Windows with npm exec

Body:

Bug Report: tailwindcss.cmd missing for v4.1.11, preventing npm exec on Windows

Environment:

Operating System: Windows 10.0.19045

Node.js Version: v22.12.0 (managed via nvm for Windows, installed as administrator)

npm Version: v10.9.0

Project Path: C:\xampp\htdocs\website (a typical XAMPP htdocs directory)

Description:
When attempting to install tailwindcss@4.1.11 and then use npm exec tailwindcss init -p to initialize the configuration, the tailwindcss.cmd executable file is not created within the node_modules.bin\ directory. This leads to the "could not determine executable to run" error.

Steps to Reproduce:

Ensure a clean environment:

    Navigate to the project directory: C:\xampp\htdocs\website

    Delete node_modules: rd /s /q node_modules

    Delete package-lock.json: del package-lock.json

    Clear npm cache: npm cache clean --force

    (Optional but tried during troubleshooting): Uninstalled and reinstalled Node.js v22.12.0 using the official installer, running as administrator, ensuring all old npm/Node.js paths were removed from environment variables and old npm/npm-cache folders were deleted.

Add tailwindcss@4.1.11 to package.json:
Ensure package.json includes:
JSON

"devDependencies": {
"tailwindcss": "^4.1.11"
}

Install project dependencies:
Bash

npm install

(No errors or critical warnings were observed during npm install.)

Verify executable presence:

Navigate to C:\xampp\htdocs\website\node_modules\.bin\

Observe: tailwindcss.cmd is missing.

Crucially: Other .cmd files (e.g., postcss.cmd if PostCSS is installed, or other package binaries) are present in this directory, indicating that npm can create .cmd files in general in this location.

Attempt to initialize Tailwind CSS:
Bash

npm exec tailwindcss init -p

Expected Behavior:
The tailwindcss.cmd executable should be created in node_modules.bin, and the npm exec tailwindcss init -p command should successfully run, creating tailwind.config.js and postcss.config.js in the project root.

Actual Behavior:
The tailwindcss.cmd executable is not created. The npm exec tailwindcss init -p command fails with the following error:

npm error could not determine executable to run
npm error A complete log of this run can be found in: C:\Users\anonymous\AppData\Local\npm-cache_logs\2025-07-06T12_55_40_156Z-debug-0.log

(Note: The specific log file name will vary, but the error message is consistent.)

Workaround/Resolution (for now):
Downgrading to a stable v3 version of Tailwind CSS resolves the issue. When npm install tailwindcss@3.4.4 --save-dev is used, the tailwindcss.cmd file is successfully created in node_modules.bin, and subsequent npm exec tailwindcss init -p (or npm run tailwind-init via a script) commands work as expected.

This suggests an issue specific to how tailwindcss@4.1.11 (or perhaps the v4 alpha/beta series) integrates with npm on Windows for binary creation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions