728x90
react sass error cannot find module sass css error
Failed to compile.
./src/index.scss (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-6-
1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--5-
oneOf-6-3!./node_modules/sass-loader/dist/cjs.js??ref--5-oneOf-6-4!./src/index.scss)
Cannot find module 'sass'
Require stack:
- /app/node_modules/sass-loader/dist/utils.js
- /app/node_modules/sass-loader/dist/index.js
- /app/node_modules/sass-loader/dist/cjs.js
- /app/node_modules/loader-runner/lib/loadLoader.js
- /app/node_modules/loader-runner/lib/LoaderRunner.js
- /app/node_modules/webpack/lib/NormalModule.js
- /app/node_modules/webpack/lib/NormalModuleFactory.js
- /app/node_modules/webpack/lib/Compiler.js
- /app/node_modules/webpack/lib/webpack.js
- /app/node_modules/react-scripts/scripts/start.js
react에서 컴파일을 할때 다음과 같이 에러가 뜨면서 페이지가 안뜨는 현상이 있을 때가 있다.
이때 해결방법은 굉장히 간단하다. 바로 sass를 설치해주면 되는 것이다.
npm install sass
혹은
npm install sass -g
로 sass를 npm으로 설치해주면 된다.
$ npm install sass
npm WARN @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.15.4 requires a peer of @babel/core@^7.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.21.0 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
다음과 같이 경고가 뜨지만 설치된 것을 확인 할 수 있다.
도움이 되셨다면 댓글이나 공감 부탁드립니다!!
728x90
'ETC > 에러 모음' 카테고리의 다른 글
extra bytes at beginning or within zipfile error 해결법 (0) | 2023.11.21 |
---|---|
django Reverse for 'home' not found (0) | 2022.01.03 |
UnicodeDecodeError: 'cp949' codec can't decode byte 0xec in position : illegal multibyte sequence (0) | 2020.12.16 |
[C언어] Visual Studio scanf 에러 해결하는 방법 (0) | 2020.12.14 |
[django] 403 forbidden Error 해결하기(CSRF token) (2) | 2020.12.13 |