3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

gulp-postcss の autoprefixer エラーの解決方法

Last updated at Posted at 2021-02-15

エラーの発生状況

gulp-postcssautoprefixer のバージョン v10 以上を利用するとエラーが発生。

Error: PostCSS plugin autoprefixer requires PostCSS 8.

エラーの原因

  • autoprefixer のバージョン v10 以上は postcss のバージョン v8 以上が必要なため
  • gulp-postcss が依存している postcss のバージョンが v7 のため

エラーの解決方法

エラーメッセージを確認するとURLが表示されています。

Migration guide for end-users:
https://github.com/postcss/postcss/wiki/PostCSS-8-for-end-users

リンクをクリックすると PostCSS 8 for end users というページが表示され、様々な利用シーンでの解決方法が記載されています。

gulp-postcss-autoprefixer-error_01.png

Gulp の場合は以下となります。

gulp-postcss-autoprefixer-error_02.png

この記述によると

  1. gulp-postcss のバージョンを v9 以上にする
  2. postcss をインストールする

というわけで、指示どおりインストールします。

npm i gulp-postcss@9.0.0 postcss -D

これでエラーが表示されなくなりました:blush:

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?