
2021년 gulp-sass를 설치하려고 망설였다
이번 완전히 신규 코딩 이슈에 종사하게 되었기 때문에, 오랜만에 1년 전까지 사용하고 있던 package.json을 잡아당기고
3시간 조사하거나 고민했던 결과, 해결했으므로 비망록으로 남깁니다.
오류 상황
node-sass의 최신 버전은 v5.0.0 (Node.js v15.x를 지원합니다) gulp-sass (v3.2.1)에서 사용하는 node-sass는 v4.14.1. 이것은 Node.js v14.x까지만 지원됩니다.
node-sass가 어떤 Node.js 버전을 지원합니까? Github의 Release를 열면 볼 수 있습니다.
htps : // 기주 b. 코 m / 탓 s / 그래서 - 헉 s / ぇ 아세 s

버전에주의!
npm intall
했다.3시간 조사하거나 고민했던 결과, 해결했으므로 비망록으로 남깁니다.
오류 상황
Windows10 환경에서 npm install gulp-sass --save-dev
그러면 아래와 같이 로그가 출력되어 설치할 수 없다.
나의 PC에는 Node.js의 【최신판(v15.5.0)】이 인스톨 되고 있었습니다.
오류 로그
cmdPS G:\data\html> npm install gulp-sass --save-dev
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
> [email protected] install G:\data\html\node_modules\gulp-sass\node_modules\node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-88_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-88_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
> [email protected] postinstall G:\data\html\node_modules\gulp-sass\node_modules\node-sass
> node scripts/build.js
Building: C:\Program Files\nodejs\node.exe G:\data\html\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'G:\\data\\html\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library='
gyp verb cli ]
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (G:\data\html\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (G:\data\html\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (G:\data\html\node_modules\which\which.js:80:29)
gyp verb `which` failed at G:\data\html\node_modules\which\which.js:89:16
gyp verb `which` failed at G:\data\html\node_modules\isexe\index.js:42:5
gyp verb `which` failed at G:\data\html\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:199:21)
gyp verb `which` failed python2 Error: not found: python2
gyp verb `which` failed at getNotFoundError (G:\data\html\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (G:\data\html\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (G:\data\html\node_modules\which\which.js:80:29)
gyp verb `which` failed at G:\data\html\node_modules\which\which.js:89:16
gyp verb `which` failed at G:\data\html\node_modules\isexe\index.js:42:5
gyp verb `which` failed at G:\data\html\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:199:21) {
gyp verb `which` failed code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Documents and Settings\●●●\AppData\Local\Programs\Python\Python39\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Documents and Settings\●●●\AppData\Local\Programs\Python\Python39\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (node:child_process:333:12)
gyp ERR! stack at ChildProcess.emit (node:events:376:20)
gyp ERR! stack at maybeClose (node:internal/child_process:1063:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "G:\\data\\html\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd G:\data\html\node_modules\gulp-sass\node_modules\node-sass
gyp ERR! node -v v15.5.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.2.7 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Documents and Settings\●●●\AppData\Roaming\npm-cache\_logs\2021-01-20T16_23_09_981Z-debug.log
debug.log를 확인하면 같은 오류가 출력되었습니다.
파이썬이 필요할 것 같은 로그가 나오므로 설치하거나 npm 캐시를 지우고 다시 설치하거나 ...
검색하고 나온 것을 한쪽 끝에서 시도했지만 고쳐지지 않습니다.
어쨌든, "아무래도 node-sass가 나쁜 것 같다"라는 것만 정보를 잡았습니다.
해결책
Node.js 버전을 [권장 버전]으로 다운 그레이드했습니다.
(Node.js를 제거 → 공식 사이트 에서 왼쪽의 "권장판"을 다운로드 & 설치

이것만으로 무사히 gulp-sass를 설치할 수있었습니다.
원인
왜 다운 그레이드하는 것만으로 해결했습니까?
원인은 gulp-sass 내에서 사용하는 node-sass에 있었다.
PS G:\data\html> npm install gulp-sass --save-dev
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
> [email protected] install G:\data\html\node_modules\gulp-sass\node_modules\node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-88_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-88_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
> [email protected] postinstall G:\data\html\node_modules\gulp-sass\node_modules\node-sass
> node scripts/build.js
Building: C:\Program Files\nodejs\node.exe G:\data\html\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'G:\\data\\html\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library='
gyp verb cli ]
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (G:\data\html\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (G:\data\html\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (G:\data\html\node_modules\which\which.js:80:29)
gyp verb `which` failed at G:\data\html\node_modules\which\which.js:89:16
gyp verb `which` failed at G:\data\html\node_modules\isexe\index.js:42:5
gyp verb `which` failed at G:\data\html\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:199:21)
gyp verb `which` failed python2 Error: not found: python2
gyp verb `which` failed at getNotFoundError (G:\data\html\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (G:\data\html\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (G:\data\html\node_modules\which\which.js:80:29)
gyp verb `which` failed at G:\data\html\node_modules\which\which.js:89:16
gyp verb `which` failed at G:\data\html\node_modules\isexe\index.js:42:5
gyp verb `which` failed at G:\data\html\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:199:21) {
gyp verb `which` failed code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Documents and Settings\●●●\AppData\Local\Programs\Python\Python39\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Documents and Settings\●●●\AppData\Local\Programs\Python\Python39\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (node:child_process:333:12)
gyp ERR! stack at ChildProcess.emit (node:events:376:20)
gyp ERR! stack at maybeClose (node:internal/child_process:1063:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "G:\\data\\html\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd G:\data\html\node_modules\gulp-sass\node_modules\node-sass
gyp ERR! node -v v15.5.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.2.7 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Documents and Settings\●●●\AppData\Roaming\npm-cache\_logs\2021-01-20T16_23_09_981Z-debug.log
Node.js 버전을 [권장 버전]으로 다운 그레이드했습니다.
(Node.js를 제거 → 공식 사이트 에서 왼쪽의 "권장판"을 다운로드 & 설치

이것만으로 무사히 gulp-sass를 설치할 수있었습니다.
원인
왜 다운 그레이드하는 것만으로 해결했습니까?
원인은 gulp-sass 내에서 사용하는 node-sass에 있었다.
node-sass가 어떤 Node.js 버전을 지원합니까? Github의 Release를 열면 볼 수 있습니다.
htps : // 기주 b. 코 m / 탓 s / 그래서 - 헉 s / ぇ 아세 s
