Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install tailwindcss CLI to React.js Vite application #17038

Open
deepaktas267 opened this issue Feb 4, 2025 · 0 comments
Open

Unable to install tailwindcss CLI to React.js Vite application #17038

deepaktas267 opened this issue Feb 4, 2025 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@deepaktas267
Copy link

What version of Bun is running?

1.2.2+c1708ea6a

What platform is your computer?

Linux 6.8.0-52-generic x86_64 x86_64

What steps can reproduce the bug?

user@user-ThinkPad-L460:~/my-project$ bun add -D tailwindcss postcss autoprefixer
bun add v1.2.2 (c1708ea)

installed [email protected]
installed [email protected]
installed [email protected] with binaries:

  • autoprefixer

[594.00ms] done
user@user-ThinkPad-L460:/my-project$ bunx tailwindcss init -p
error: could not determine executable to run for package tailwindcss
user@user-ThinkPad-L460:
/my-project$

What is the expected behavior?

Install Tailwind CSS with Bun
bun add -D tailwindcss postcss autoprefixer

Initialize Tailwind CSS Configuration
bunx tailwindcss init -p

this will generate two files:
tailwind.config.js
postcss.config.js

Configure Tailwind in tailwind.config.js
Open tailwind.config.js and update the content array to include your JSX and JS files:

/** @type {import('tailwindcss').Config} /
export default {
content: ["./index.html", "./src/**/
.{js,jsx}"],
theme: {
extend: {},
},
plugins: [],
};

Add Tailwind Directives to CSS
Open src/index.css (or create it if not present) and add:
@tailwind base;
@tailwind components;
@tailwind utilities;

Start the Development Server
Run:
bun dev

This will start the Vite development server.
Now you have a Vite + React + Tailwind CSS setup using Bun as the package manager!

What do you see instead?

user@user-ThinkPad-L460:~/my-project$ bun add -D tailwindcss postcss autoprefixer
bun add v1.2.2 (c1708ea)

installed [email protected]
installed [email protected]
installed [email protected] with binaries:

  • autoprefixer

[594.00ms] done
user@user-ThinkPad-L460:/my-project$ bunx tailwindcss init -p
error: could not determine executable to run for package tailwindcss
user@user-ThinkPad-L460:
/my-project$

Additional information

No response

@deepaktas267 deepaktas267 added bug Something isn't working needs triage labels Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant