728x90
sass를 설치하기 위해
yarn add node-sass@4.14.1를 설치해주었다.
책 리액트를 다루는 기술에선 뒤에 버전을 명시해주었지만,
버전을 명시해주어 설치하니 아래와 같은 에러가 떴다.
gyp ERR! node -v v16.0.0
gyp ERR! node-gyp -v v3.8.0
인터넷을 찾아보니 노드의 버전이 16이라서 안되는 것 같았다.
yarn add node-sass
를 하면 설치가 되나,
실행할때 위와 같은 에러가 뜰것이다.
./src/SassComponent.scss (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-6-1!./node_modules/postcss-load/cjs.js??ref--5-oneOf-6-1!./node_modules/postcss-loader/5-oneOf-6-3!./node_modules/sass-loader/dist/cjs.js??rsrc??postcss!./node_modules/resolve-url-loader??ref--5-oneOf-6-3!./node_modules/sass-loader/dist/cjs.js??ref--5-5.0.0.oneOf-6-4!./src/SassComponent.scss)
Node Sass version 6.0.1 is incompatible with ^4.0.0 || ^5.0.0.
이것은 리액트 자체에서 sass를 지원을 해주지않는것!
버전을 14로 낮춰서
sass의 버전 4.14.1 설치후, 실행하니 잘 되었다.
버전을 낮추는 법은 nvm을 이용해서 한 로컬에서
node버전을 여러가지 쓸 수 있도록한다.
https://github.com/coreybutler/nvm-windows
를 참고하였다.
알려주신 예빈님 감사합니당
1.1.8 버전을 처음에 설치했으나, exit status5 에러가 떴다.
알고보니 버전 문제인듯..
제거 후 1.1.7 버전을 설치 후
nvm을 이용하여 노드 14버전을 설치해주니
sass 사용이 가능해졌다.
728x90