2021년 gulp-sass를 설치하려고 망설였다
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: fsevents@^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: fsevents@^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
버전에주의!
지금까지 「최신이야말로 정의」라고 생각해 최신판을 넣어 왔습니다만, 이런 함정이 있다고는 생각하지 않았습니다.
어떤 소프트 등을 사용하고 있어도 그렇습니다만, 자신이 사용하는 패키지에 맞추어 인스톨 하는 버젼을 선택하는지, 사용하는 패키지가 최신판에 따라잡고 있지 않다면 대체의 것을 찾는 것이 중요하네요.
Reference
이 문제에 관하여(2021년 gulp-sass를 설치하려고 망설였다), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/aki0923f/items/150882597ea112a2418c텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)