Day 264/300 PostCSS plugin postcss-flexbugs-fixes requires PostCSS 8.

(一)需求

react的项目,在安装成功后,页面报错。找教程没有找到合适的。

PostCSS plugin postcss-flexbugs-fixes requires PostCSS 8.

(二)分析

需要升级PostCSS的版本到8

(三)解决

# 卸载
npm uninstall tailwindcss postcss autoprefixer
# 重新安装
npm install tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^8 autoprefixer@^9

运行起来生效了。

其他,需要在App.css 添加引入

@tailwind base;
@tailwind components;
@tailwind utilities;

参考链接

https://www.tailwindcss.cn/docs/guides/create-react-app

猜你喜欢

转载自blog.csdn.net/xinghuowuzhao/article/details/127430179