我正在尝试添加顺风css与React应用程序。我遵循了顺风文档,如何设置顺风与React。
我用最新版本的tailwind试过了,我检查了Nodejs和npm安装的很好。
但是当我运行npm run start
的时候,它总是得到一个错误,我无法修复这个问题。
package.json
{
"name": "tailwind-css",
"version": "0.1.0",
"homepage": "",
"private": true,
"dependencies": {
"@craco/craco": "^6.1.2",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.3"
},
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"engines": {
"npm": "6.14.6",
"node": "12.18.4"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"autoprefixer": "^9.8.6",
"postcss": "^7.0.36",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.2"
}
}
请任何人帮助。
3条答案
按热度按时间xfb7svmp1#
如果你遵循顺风文档的方式,那么试试这个,在
package.json
并像这样检查
craco.config.js
。快乐编码!
z9smfwbn2#
只需通过以下方式将您的react-script从v4更新为最新的5版本:npm安装react-scripts@latest。如果您将继续使用版本4,则必须使用craco
这对我很有帮助
bkhjykvo3#
将此内容写入tailwind.config.js
模块.导出=