ReactFix
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • React
  • React Native
  • Programming
  • Object Oriented Programming

Sunday, November 6, 2022

[FIXED] how to install tailwindcss in react js

 November 06, 2022     jquery, reactjs, tailwind-css   

Issue

I am new for react js and tailwind components.

I successfully install react in my page. Its working fine.

But I want install tailwind css for old npm, node version like as

{ node: 'v10.15.3', npm: '7.23.0' }

I trying to create tailwind config file but i got error like below

NPM\myapp>npx tailwindcss init
(node:72880) ExperimentalWarning: The fs.promises API is experimental
C:\Users\EXQ504\NPM\myapp\node_modules\@tailwindcss\postcss7-compat\node_modules\color\index.js:257
                        lum[i] = (chan <= 0.039_28) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
                                          ^^^^^

SyntaxError: Invalid or unexpected token
    at new Script (vm.js:80:7)
    at createScript (vm.js:274:10)
    at Object.runInThisContext (vm.js:326:10)
    at Module._compile (internal/modules/cjs/loader.js:664:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)

I searched some long time but I didn't found good answer in my search criteria. Any one can help ... Thanks in advance.


Solution

tailwind requires node 12.13+

https://tailwindcss.com/docs/installation

please upgrade your node version



Answered By - Prasanna
Answer Checked By - - Candace Johnson (ReactFix Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Post Older Post Home

Featured Post

Is Learning React Difficult?

React is difficult to learn, no ifs and buts. React isn't inherently difficult to learn. It's a framework that's different from ...

Total Pageviews

Copyright © ReactFix