I'm trying to install TailwindCSS 2.0 with the create-react-app --template typescript
setup with but I keep running in errors. I have followed the documentation on their website for react https://tailwindcss.com/docs/guides/create-react-app, but I i'm getting the error Cannot find module 'autoprefixer'
when i try to npx tailwind init
. I have also tried looking around to see how other people are doing it up but I also run into other issues, does anyone know a alternative way to setup tailwind? Thanks!
Here is my package.json
:
"name": "tailwind-example-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@craco/craco": "^5.9.0",
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/react": "^11.2.2",
"@testing-library/user-event": "^12.5.0",
"@types/jest": "^26.0.16",
"@types/node": "^12.19.8",
"@types/react": "^16.14.2",
"@types/react-dom": "^16.9.10",
"autoprefixer": "^9.8.6",
"axios": "^0.21.0",
"postcss": "^7.0.35",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "4.0.1",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.1",
"web-vitals": "^0.2.4"
},
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"typescript": "^4.2.0-dev.20201205"
}
}
npm install @types/autoprefixer
– Rogelio