Deploy failing due to missing tailwindcss

Hi,
the tailwind css is not working while trying to deploy to Netflify although it works fine locally.
During the build i get an error that it’s missing but it can be found in the package.json file.
Here are the package.json for the build and the error:
"scripts": { "dev": "concurrently \"npm run build:css\" \"vite\"", "build": "npm run build:css:prod && vite build", "preview": "vite preview", "build:css": "tailwindcss -i ./src/index.css -o ./src/tailwind-output.css --watch", "build:css:prod": "tailwindcss -i ./src/index.css -o ./src/tailwind-output.css --minify", "lint": "eslint ." }, "dependencies": { "axios": "^1.10.0", "lucide-react": "^0.525.0", "react": "^19.1.0", "react-dom": "^19.1.0", "react-router-dom": "^7.6.3" }, "devDependencies": { "@eslint/js": "^9.30.1", "@types/react": "^19.1.8", "@types/react-dom": "^19.1.6", "@vitejs/plugin-react-swc": "^3.10.2", "autoprefixer": "^10.4.21", "concurrently": "^9.2.0", "eslint": "^9.30.1", "eslint-plugin-react-hooks": "^5.2.0", "eslint-plugin-react-refresh": "^0.4.20", "globals": "^16.3.0", "postcss": "^8.5.6", "tailwindcss": "^4.1.11", "vite": "^7.0.3" }

12:44:00 AM: Netlify Build 12:44:00 AM: ──────────────────────────────────────────────────────────────── 12:44:00 AM: ​ 12:44:00 AM: ❯ Version 12:44:00 AM: @netlify/build 34.3.0 12:44:00 AM: ​ 12:44:00 AM: ❯ Flags 12:44:00 AM: accountId: 5e20cc814d610eb66df5c108 12:44:00 AM: baseRelDir: true 12:44:00 AM: buildId: 6887fd2314ae37000845d29b 12:44:00 AM: deployId: 6887fd2314ae37000845d29d 12:44:00 AM: ​ 12:44:00 AM: ❯ Current directory 12:44:00 AM: /opt/build/repo/frontend 12:44:00 AM: ​ 12:44:00 AM: ❯ Config file 12:44:00 AM: /opt/build/repo/netlify.toml 12:44:00 AM: ​ 12:44:00 AM: ❯ Context 12:44:00 AM: production 12:44:00 AM: ​ 12:44:00 AM: build.command from netlify.toml 12:44:00 AM: ──────────────────────────────────────────────────────────────── 12:44:00 AM: ​ 12:44:00 AM: $ npm run build 12:44:00 AM: > frontend@0.0.0 build 12:44:00 AM: > npm run build:css:prod && vite build 12:44:00 AM: > frontend@0.0.0 build:css:prod 12:44:00 AM: > tailwindcss -i ./src/index.css -o ./src/tailwind-output.css --minify 12:44:00 AM: sh: 1: tailwindcss: not found 12:44:00 AM: ​ 12:44:00 AM: "build.command" failed 12:44:00 AM: ──────────────────────────────────────────────────────────────── 12:44:00 AM: ​ 12:44:00 AM: Error message 12:44:00 AM: Command failed with exit code 127: npm run build (https://ntl.fyi/exit-code-127) 12:44:00 AM: ​ 12:44:00 AM: Error location 12:44:00 AM: In build.command from netlify.toml: 12:44:00 AM: npm run build 12:44:00 AM: ​ 12:44:00 AM: Resolved config 12:44:00 AM: build: 12:44:00 AM: base: /opt/build/repo/frontend 12:44:00 AM: command: npm run build 12:44:00 AM: commandOrigin: config 12:44:00 AM: publish: /opt/build/repo/frontend/dist 12:44:00 AM: publishOrigin: config 12:44:01 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2) 12:44:01 AM: Build failed due to a user error: Build script returned non-zero exit code: 2 12:44:01 AM: Failing build: Failed to build site 12:44:01 AM: Finished processing build request in 13.133s

Any form of assistance would be greatly appreciated.
Thank you for assistance.

@Asarez31 See this answer:

You also appear to be using a command that is different from the current tailwindcss documentation.

@nathanmartin Hello, i don’t understand the solution he provided. Does he mean that he moved every single html and css file to a different folder or he created a new repository just for those files? This is how my directory looks

@Asarez31 Ignore “the solution” from that user, they just gave up.

I was pointing specifically to the answer provided by Netlify’s staff, directly as quoted.

Check the tailwind documentation that was linked:
https://tailwindcss.com/docs/installation/tailwind-cli

Tailwind have examples for different situations, for Vite and the Tailwind CLI etc.
Neither of which look like the command that you are running in your build log.

The Vite specific documentation is here:
https://tailwindcss.com/docs/installation/using-vite

@nathanmartin Thank you so much that actually fixed it, I was using the wrong command as you said.
Thank you for the assistance.