-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
sh: tailwindcss: command not found #4953
-
I'm trying to use TailwindCSS, but I can't
Everytime I put npx tailwindcss -o tailwind.css, the bash gives me a: sh: tailwindcss: command not found
The steps I follow are:
- Init nodejs: npm init
- Install tailwindcss:
I have had use npm install -D tailwindcss@latest postcss@latest autoprefixer@latest
And also npm i -D tailwindcss - Build tailwind:
npx tailwindcss -o tailwind.css
It gives me: sh: tailwindcss: command not found
Beta Was this translation helpful? Give feedback.
All reactions
-
👀 1
Replies: 5 comments 15 replies
-
Try to delete your node_module and reinstall all the package.
Beta Was this translation helpful? Give feedback.
All reactions
-
👎 2
-
If your computer is MacOS, run brew install tailwindcss
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 38 -
👎 7 -
😕 4
-
thank you so much
it worked
Beta Was this translation helpful? Give feedback.
All reactions
-
it worked too
Beta Was this translation helpful? Give feedback.
All reactions
-
thanks a lot ,it worked
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks it worked
Beta Was this translation helpful? Give feedback.
All reactions
-
I thought tailwindcss
was moved into @tailwindcss/cli
.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 4
-
Beta Was this translation helpful? Give feedback.
All reactions
-
npm install -D tailwindcss@3 postcss autoprefixer
npx tailwindcss init -p
It worked after running this command and add
@tailwind base;
@tailwind components;
@tailwind utilities;
in index.css
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 9 -
😄 1
-
this works on macOS!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1 -
😕 1
-
It works like a charm after spending countless days debugging and going through the documentations. Thank you very much.
Beta Was this translation helpful? Give feedback.
All reactions
-
🚀 1
-
thanks bro
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.
All reactions
-
OMG!!!
i swear after spending in hours debugging, i feel like you're an angel.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Perhaps VERSION 3 is what you need
my initial setup was just React 19 in Webpack, and i'm not going to install tailwind globally
- install Tailwind CSS
npm install -D tailwindcss@3 postcss autoprefixer npx tailwindcss init -p
- Configure your template paths
make sure your content lists where your template files are. for me it is on src and it should detect the .js
, or .jsx
files
/** @type {import('tailwindcss').Config} */ module.exports = { content: ["./src/**/*.{js,jsx}"], theme: { extend: {}, }, plugins: [], };
- Add the Tailwind directives to your CSS
add these lines at the top of your index.css
file
@tailwind base; @tailwind components; @tailwind utilities;
- Import the css file
my index.css
was already imported within index.js
- start your build process
npm start
- Start using Tailwind in your project
export default function App() { return ( <h1 className="text-3xl font-bold underline"> Hello world! </h1> ) }
Beta Was this translation helpful? Give feedback.
All reactions
-
👎 1