Module build failed (from ./node_modules/postcss-loader/dist/cjs.js): Error: PostCSS plugin autopref

  行业动态     |      2024-01-15 21:03

使用vue+uni-app开发微信小程序运行后报错

Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
Error: PostCSS plugin autoprefixer requires PostCSS 8.
Migration guide for end-users:
https://github.com/postcss/postcss/wiki/PostCSS-8-for-end-users

解决办法

报错原因:autoprefixer版本过高

解决方案:降低autoprefixer版本

执行:npm i postcss-loader autoprefixer@8.0.0

然后再次运行即可成功