Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issues installing Tailwindcss, specifically with "npx tailwindcss init"

I'm following the documentation, however when use:

npx tailwindcss init

Not working:

Error: Cannot find module 'C:\path\to\project\tailwindcss\lib\cli.js'

like image 876
Nandril Avatar asked Feb 16 '26 03:02

Nandril


2 Answers

Step : 1 Correct you directory path like this C:\Users\user\Documents\Web Dev\Tailwindcss_AlpineJs\pratice tailwind then try this command npx tailwindcss init

Step : 2 Not working above step : 1 then try this command : npx tailwindcss-cli@latest init -p.

like image 66
Mayank Avatar answered Feb 18 '26 00:02

Mayank


The latest version Tailwindcss@4 does not support -> npx tailwindcss init

Installation Using PostCSS

I installed the Tailwindcss@3 version , the command is running fine . Steps :-

npm init -y 
npm install -D tailwindcss@3 @tailwindcss/postcss postcss
npx tailwindcss init -p
like image 29
Tanya sharma Avatar answered Feb 18 '26 00:02

Tanya sharma