Error: PostCSS plugin autoprefixer requires PostCSS 8问题解决办法
warning:
这篇文章距离上次修改已过448天,其中的内容可能已经有所变动。
解释:
这个错误表明你的项目中使用的autoprefixer插件需要PostCSS版本8,但是你的项目环境中可能没有安装正确的PostCSS版本。
解决方法:
- 首先确认你的
package.json文件中的依赖版本是正确的,即autoprefixer依赖postcss版本8。 如果版本正确,运行以下命令来更新你的
node_modules:npm install或者如果你使用
yarn:yarn install如果上述步骤不能解决问题,可能需要手动安装或更新
postcss到版本8:npm install postcss@^8.0.0 --save-dev或者使用
yarn:yarn add postcss@^8.0.0 --dev- 安装完成后,重新运行你的构建过程,看错误是否已经解决。
评论已关闭