0

Here is my history:

At home a installed tailwindcss and it simply works (My PC has Ubuntu Linux).

At work, I use Windows 10 and it just does not work at all. I am crazy to start a new project with tailwindcss!

Here is the error I've got (whem I run npx tailwindcss init):

PS C:\Bitnami\wampstack-7.4.22-0\apache2\htdocs\b&t-cambio\wp-content\themes\btcambio> npx tailwindcss init
't-cambio\wp-content\themes\btcambio\node_modules\.bin\' it is not recognized as an internal or external command, operable program, or batch file. 
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'C:\Bitnami\wampstack-7.4.22-0\apache2\htdocs\tailwindcss\lib\cli.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

I've verified if NPM in on my PATH and it sure is. I have used npm dozen of times before and there was no errors.

My npm, npx and node versions are:

$ npm --version && npx --version && node --version
8.3.0
8.3.0
v16.13.1

I have gone to all stackoverflow questions related to tailwind issues, and went through lots of forums, but with no success.

Someone here knows what is going on?

For now I just want to use pure CSS with tailwindcss, whith no preprocessors...

samu101108
  • 675
  • 7
  • 23

1 Answers1

2

Oh gosh! about 10 hours lost. I found in this question a solution: Cannot find module 'autoprefixer' when running npx tailwindcss init -p command

The error is something related to the tailwind\lib\cli so the solution is to run npx tailwindcss-cli@latest init -p

At the first run it will ask if you want to install the package. After that, it' works!

It the docs (step 4) Start the Tailwind CLI build process has the same command issue... so where the command is tailwindcss, use tailwindcss-cli@latest then the thing runs smoothly.

samu101108
  • 675
  • 7
  • 23
  • 1
    thanks for the simple solution. have been trying for 2hrs and thousands of times of reinstalling finally came across this. Thanks for the contribution – Milan Lakhani Mar 28 '22 at 23:12