본문 바로가기
컴퓨터 사이언스/에러(error) 노트

autoprefixer와 postcss 동시에 설치할 때 오류나는 경우

by 메리뉴데이 2022. 10. 14.

 

 

autoprefixer와 postcss 패키지 설치하고 package.json 파일 확인해보니 위와 같다.

 

 

 

 

npm run dev로 개발서버 열어보니 다음과 같은 오류가 발생한다.

 

 

 

 

 

이유는 바로 버전 충돌.

 

 

 

 

 

 

postcss plugin autoprefixer requires postcss 8로 오류 검색해보면,

다음과 같은 이유를 알 수 있다.

아래 내용은, PostCSS는 버전 8로 업데이트 되었지만, PostCSS CLI가 아직 새 PostCSS 8+ API를 사용하는 PostCSS 플러그인를 다룰 수 있도록 업데이트가 안되어 있다는 것이다. 

오토프리픽서 10버전 이후로는 새 PostCSS 8 API를 사용한다. 

 

 

 

 

 

 

 

https://stackoverflow.com/questions/64057023/error-postcss-plugin-autoprefixer-requires-postcss-8-update-postcss-or-downgra

 

Error: PostCSS plugin autoprefixer requires PostCSS 8. Update PostCSS or downgrade this plugin

I am getting this error whenever I run npm start. I tried a couple of fixes but none of them work for me. I tried to change the version of autoprefixer to 9.8.6 but it didn't work. Please help me w...

stackoverflow.com

 

 

 

 

 

 

 

autoprefixer를 버전 9로 다운그레이드하면 , postcss와의 버전 충돌이 일어나지 않기 때문에 에러가 해결된다 !

 

 

 

 

 

버전을 바꿀때는 @(버전숫자) 형식으로 작성한다.

 

이렇게 autoprefixer 버전을 9로 다운그레이드하면 개발서버가 정상적으로 잘 열린다.

해결.