Post

node-sass 오류

예전에 작업해두었던 todo list app에 새로운 기능을 추가하기 위해 서버를 실행시켰더니 발생한 오류이다

1
2
3
4
5
6
7
8
9
10
11
12
13
14
ERROR in ./src/style.scss (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[2]!./node_modules/resolve-url-loader/index.js??ruleSet[1].rules[1].oneOf[7].use[3]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[4]!./src/style.scss)
Module Error (from ./node_modules/sass-loader/dist/cjs.js):
Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (115)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v7.0.1

ERROR in ./src/style.scss (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOfrc/style.scss)
Module build failed (from ./node_modules/resolve-url-loader/index.js):
TypeError: Cannot read properties of undefined (reading 'replace')
    at process (C:\Users\user\Desktop\JS-project\typescript-todo-app\node_modules\resolve-url-loader\lib\engine\postcss.js:28:19)
    at Object.resolveUrlLoader (C:\Users\user\Desktop\JS-project\typescript-todo-app\node_modules\resolve-url-loader\index.js:213:14)

webpack compiled with 2 errors and 2 warnings
No issues found.

loader를 설치하지 않아서 발생한 오류.

해결 1

npm i -D sass sass-loader

나의 해결

loader를 설치하면 해결되는 문제지만,
node-sass는 호환성이나 새로운 기능 추가 등의 업데이트가 종료되었고, 추후에는 dart sass로 옮겨진다는 내용을 보았다. 그래서 dart sass로 변경하였다.

1
2
npm remove node-sass
npm i node-sass@npm:sass -D

dart sass

dart sass 공식 문서

This post is licensed under CC BY 4.0 by the author.