error일지

npm install 시 node-sass error

rachel_13 2022. 8. 31. 11:02

https://velog.io/@corner3499/Node-sass-%EC%84%A4%EC%B9%98-%EC%97%90%EB%9F%AC

1. node-sass 버전 지정 설치

npm i node-sass@4.14.1
or
npm i node-sass@4.9.0

2. window build tools 사용해서 패키징 설치

npm install --global --production windows-build-tools

3. yarn upgrade로 패키지 업데이트 & yarn add node-sass

yarn upgrade
yarn add node-sass

yarn add node-sass@4.0.0 으로 버전지정 재설치

package.json에 설정된 node-sass 버전이 로컬에 설치된 node 버전과 맞지 않아서 발생하는 오류

그랬더니 이제 

Error: Node Sass version 7.0.1 is incompatible with ^4.0.0.

이런 오류가 나옴

https://stackoverflow.com/questions/70281346/node-js-sass-version-7-0-0-is-incompatible-with-4-0-0-5-0-0-6-0-0

 

Node.js Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0

I used Node.js v16.13.1 and created a React application. I tried to use Sass, but when I tried to run it, I got this error: Node Sass version 7.0.0 is incompatible with ^4.0.0 || ^5.0.0 || ^6.0.0

stackoverflow.com

node-sass대신 sass 설치하라는 답변..ㅇㅅㅇ

yarn remove node-sass
yarn add -D sass