npx setup tailwind-rn throws Error: Cannot find module 'postcss'
See original GitHub issuenpx setup-tailwind-rn
✔ Install dependencies
✖ Create Tailwind config
→ info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Add scripts
Error: Command failed with exit code 1: yarn tailwindcss init
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'postcss'
Require stack:
- /Users/ashish/projects/tarana/node_modules/tailwindcss/lib/lib/generateRules.js
- /Users/ashish/projects/tarana/node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js
- /Users/ashish/projects/tarana/node_modules/tailwindcss/lib/processTailwindFeatures.js
- /Users/ashish/projects/tarana/node_modules/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 Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/ashish/projects/tarana/node_modules/tailwindcss/lib/lib/generateRules.js:6:39)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/ashish/projects/tarana/node_modules/tailwindcss/lib/lib/generateRules.js',
'/Users/ashish/projects/tarana/node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js',
'/Users/ashish/projects/tarana/node_modules/tailwindcss/lib/processTailwindFeatures.js',
'/Users/ashish/projects/tarana/node_modules/tailwindcss/lib/cli.js'
]
}
error Command failed with exit code 1.
yarn run v1.22.11
$ /Users/ashish/projects/tarana/node_modules/.bin/tailwindcss init
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
at makeError (file:///Users/ashish/.npm/_npx/fce68b938067d432/node_modules/execa/lib/error.js:59:11)
at handlePromise (file:///Users/ashish/.npm/_npx/fce68b938067d432/node_modules/execa/index.js:119:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Task.task (file:///Users/ashish/.npm/_npx/fce68b938067d432/node_modules/setup-tailwind-rn/cli.js:46:4)
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Tailwind CLI fails with "Cannot find module postcss" since v3 ...
What operating system are you using? macOS (Monterey). Describe your issue. Run the CLI command: npx tailwindcss@3.0.12. This is the result:.
Read more >Loading PostCSS Plugin failed: Cannot find module 'tailwindcss'
The package is tailwindcss not tailwind : npm install -D tailwindcss postcss autoprefixer vite npm tailwindcss init.
Read more >PostCSS - "Error: cannot find module 'tailwindcss'" - HUGO
Here's my Windows environment. You might try deleting the node_modules directory, then run npm install again. And you do not need to run...
Read more >Install Tailwind CSS using PostCSS
Installing Tailwind CSS as a PostCSS plugin is the most seamless way to integrate it with build tools like webpack, Rollup, Vite, and...
Read more >node_modules/next/dist/build/webpack/loaders/css ... - You.com
I manage to create the nextJS project on Users/ directory and it turns out to fix the error. Before that, I created the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I posted setup steps here that might help: https://github.com/vadimdemedes/tailwind-rn/issues/128#issuecomment-1019372506
you can install postcss, then run the script again