• 로그인
  • 장바구니에 상품이 없습니다.

home2 게시판 React 게시판 npm으로 sass설치 시 Sass version incompatible 오류

npm으로 sass설치 시 Sass version incompatible 오류

9 글 보임 - 1 에서 9 까지 (총 9 중에서)
  • 글쓴이
  • #4779

    kylee
    참가자

    sass설치 시 Error: Node Sass version 5.0.0 is incompatible with ^4.0.0라는 오류가 발생해 구글링해서 삭제 후 4.14.1 버전으로 재설치하고 있습니다. 그런데 터미널에 npm install node-sass@4.14.1를 입력하면 긴 에러 문구와 함께 설치가 되지 않습니다... <br />
    이유를 찾을 수가 없어서 어떻게 해야 하는지 모르겠습니다.

    #4781

    codingapple
    키 마스터

    무슨 에러인지 알려주시면 됩니다 

    nodejs 14버전을 쓰면 

    npm uninstall node-sass

    npm uninstall -g node-sass

    이걸로 깔끔히 삭제하고 

     

    npm install node-sass@4.14.1

    해보면 됩니다 

     

    nodejs 16버전 이상을 쓴다면 

    npm uninstall node-sass

    npm uninstall -g node-sass

    이걸로 깔끔히 삭제하고 

    1. npm install node-sass@6 혹은 yarn add node-sass@6 으로 6버전 설치해주시고 

    2. 프로젝트 폴더 내에 node_modules 폴더, yarn.lock, package-lock.json 보이는걸 다 삭제하시고 

    3. 터미널에서 yarn install 혹은 npm install로 node_modules 폴더 재설치 해주시면 잘 되는듯요 

     

    #4822

    kylee
    참가자
    npm ERR! code 1
    npm ERR! path C:\Users\anach\Documents\programming\shop\node_modules\node-sass
    npm ERR! command failed
    npm ERR! command C:\Windows\system32\cmd.exe /d /s /c "node scripts/build.js"
    npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\anach\Documents\programming\shop\node_modules\node-gyp\bin\node-gyp.js rebuild --
    
    npm ERR! gyp verb could not find "python". checking python launcher
    npm ERR! gyp verb could not find "python". guessing location
    npm ERR! gyp verb ensuring that file exists: C:\Python27\python.exe
    npm ERR! gyp ERR! configure error
    npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.npm ERR! gyp ERR! stack at PythonFinder.failNoPython (C:\Users\anach\Documents\programming\shop\node_modules\node-gyp\lib\configure.js:484:19)
    npm ERR! gyp ERR! stack at PythonFinder. (C:\Users\anach\Documents\programming\shop\node_modules\node-gyp\lib\configure.js:509:16)
    npm ERR! gyp ERR! stack at callback (C:\Users\anach\Documents\programming\shop\node_modules\graceful-fs\polyfills.js:295:20)
    npm ERR! gyp ERR! stack at FSReqCallback.oncomplete (node:fs:183:21)
    npm ERR! gyp ERR! System Windows_NT 10.0.18363
    npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\anach\\Documents\\programming\\shop\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
    npm ERR! gyp ERR! cwd C:\Users\anach\Documents\programming\shop\node_modules\node-sass
    npm ERR! gyp ERR! node -v v15.1.0
    npm ERR! gyp ERR! node-gyp -v v3.8.0
    npm ERR! gyp ERR! not ok
    npm ERR! Build failed with error code: 1
    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\anach\AppData\Local\npm-cache\_logs20-11-15T06_43_11_794Z-debug.log
    
    
    

     

    에러 문구가 굉장히 길게 떠서 어느 부분을 알려드려야 할지 모르겠어서 일단 전부 첨부했습니다. 
    글로벌로 삭제하고 재시도도 해보았고, yarn 설치 후 시도도 해봤는데 여전히 같은 오류입니다...

    답변 미리 감사드립니다.

    #4823

    codingapple
    키 마스터

    https://hisk.io/how-to-fix-node-js-gyp-err-cant-find-python-executable-python-on-windows/

    이걸 따라해보도록 합시다 

    #12168

    김영휘
    참가자

    저도 윗분이랑 같은 오류가 계속 발생되네요... 그뒤로 scss 부분부터 막혀서 .. 진행ㅇ ㅣ안되네요 ㅜㅜ 

    강의에서 나온대로 설치는 잘 되지만  실행이 안되고 , 다시 삭제후 버전 낮춰서 설치하려하면 윗분 긴 오류처럼 뜨고 ... 미치겠습돠,.

    댓글에 올려주신곳은 접속이 안되네요 ㅜ

     

    #12177

    codingapple
    키 마스터

    해당 강의하단에 있는 nodejs 14버전으로 낮춰서 하는거 따라해보셨나요

    어떤 에러가 뜨나요 

    #12186

    김영휘
    참가자

    전부 삭제후에 14버전으로 설치하려고 하면 오류가 발생됩니다. 

    PS C:\Users\ncodi_PC1\Desktop\react\shop> npm install node-sass@4.14.1
    npm ERR! code 1
    npm ERR! path C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\node-sass
    npm ERR! command failed
    npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
    npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
    npm ERR! gyp info it worked if it ends with ok
    npm ERR! gyp verb cli [
    npm ERR! gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
    npm ERR! gyp verb cli 'C:\\Users\\ncodi_PC1\\Desktop\\react\\shop\\node_modules\\node-gyp\\bin\\node-gyp.js',
    npm ERR! gyp verb cli 'rebuild',
    npm ERR! gyp verb cli '--verbose',
    npm ERR! gyp verb cli '--libsass_ext=',
    npm ERR! gyp verb cli '--libsass_cflags=',
    npm ERR! gyp verb cli '--libsass_ldflags=',
    npm ERR! gyp verb cli '--libsass_library='
    npm ERR! gyp verb cli ]
    npm ERR! gyp info using node-gyp@3.8.0
    npm ERR! gyp info using node@16.5.0 | win32 | x64
    npm ERR! gyp verb command rebuild []
    npm ERR! gyp verb command clean []
    npm ERR! gyp verb clean removing "build" directory
    npm ERR! gyp verb command configure []
    npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
    npm ERR! gyp verb which failed Error: not found: python2
    npm ERR! gyp verb which failed at getNotFoundError (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:13:12)
    npm ERR! gyp verb which failed at F (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:68:19)
    npm ERR! gyp verb which failed at E (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:80:29)
    npm ERR! gyp verb which failed at C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:89:16
    npm ERR! gyp verb which failed at C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\isexe\index.js:42:5
    npm ERR! gyp verb which failed at C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\isexe\windows.js:36:5
    npm ERR! gyp verb which failed at FSReqCallback.oncomplete (node:fs:195:21)
    npm ERR! gyp verb which failed python2 Error: not found: python2
    npm ERR! gyp verb which failed at getNotFoundError (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:13:12)
    npm ERR! gyp verb which failed at F (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:68:19)
    npm ERR! gyp verb which failed at E (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:80:29)
    npm ERR! gyp verb which failed at C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:89:16
    npm ERR! gyp verb which failed at C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\isexe\index.js:42:5
    npm ERR! gyp verb which failed at C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\isexe\windows.js:36:5
    npm ERR! gyp verb which failed at FSReqCallback.oncomplete (node:fs:195:21) {
    npm ERR! gyp verb which failed code: 'ENOENT'
    npm ERR! gyp verb which failed }
    npm ERR! gyp verb check python checking for Python executable "python" in the PATH
    npm ERR! gyp verb which failed Error: not found: python
    npm ERR! gyp verb which failed at getNotFoundError (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:13:12)
    npm ERR! gyp verb which failed at F (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:68:19)
    npm ERR! gyp verb which failed at E (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:80:29)
    npm ERR! gyp verb which failed at C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:89:16
    npm ERR! gyp verb which failed at C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\isexe\index.js:42:5
    npm ERR! gyp verb which failed at C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\isexe\windows.js:36:5
    npm ERR! gyp verb which failed at FSReqCallback.oncomplete (node:fs:195:21)
    npm ERR! gyp verb which failed python Error: not found: python
    npm ERR! gyp verb which failed at getNotFoundError (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:13:12)
    npm ERR! gyp verb which failed at F (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:68:19)
    npm ERR! gyp verb which failed at E (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:80:29)
    npm ERR! gyp verb which failed at C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\which\which.js:89:16
    npm ERR! gyp verb which failed at C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\isexe\index.js:42:5
    npm ERR! gyp verb which failed at C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\isexe\windows.js:36:5
    npm ERR! gyp verb which failed at FSReqCallback.oncomplete (node:fs:195:21) {
    npm ERR! gyp verb which failed code: 'ENOENT'
    npm ERR! gyp verb which failed }
    npm ERR! gyp verb could not find "python". checking python launcher
    npm ERR! gyp verb could not find "python". guessing location
    npm ERR! gyp verb ensuring that file exists: C:\Python27\python.exe
    npm ERR! gyp ERR! configure error
    npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
    npm ERR! gyp ERR! stack at PythonFinder.failNoPython (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\node-gyp\lib\configure.js:484:19)
    npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\node-gyp\lib\configure.js:509:16)
    npm ERR! gyp ERR! stack at callback (C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\graceful-fs\polyfills.js:299:20)
    npm ERR! gyp ERR! stack at FSReqCallback.oncomplete (node:fs:195:21)
    npm ERR! gyp ERR! System Windows_NT 10.0.19043
    npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ncodi_PC1\\Desktop\\react\\shop\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
    npm ERR! gyp ERR! cwd C:\Users\ncodi_PC1\Desktop\react\shop\node_modules\node-sass
    npm ERR! gyp ERR! node -v v16.5.0
    npm ERR! gyp ERR! node-gyp -v v3.8.0
    npm ERR! gyp ERR! not ok
    npm ERR! Build failed with error code: 1

    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\ncodi_PC1\AppData\Local\npm-cache\_logs\2021-07-27T05_23_17_249Z-debug.log

    #12187

    김영휘
    참가자

    어떻게 하다보니까 해결 되었습니다. 나중에 어떤오류가 또 발생될지는 모르지만 감사합니다.

     

    #12190

    codingapple
    키 마스터

    다행이군요 python 2 없다는 에러는 터미널에

    npm install --global windows-build-tools
    이거 입력해보고 프로젝트내에 node_modules 폴더 싹 지우고 npm install 해서 node_modules 폴더 다시 설치하면 될듯요 

9 글 보임 - 1 에서 9 까지 (총 9 중에서)
  • 답변은 로그인 후 가능합니다.

About

현재 월 700명 신규수강중입니다.

  (09:00~20:00) 빠른 상담은 카톡 플러스친구 코딩애플 (링크)
  admin@codingapple.com
  이용약관
ⓒ Codingapple, 강의 예제, 영상 복제 금지
top

© Codingapple, All rights reserved. 슈퍼로켓 에듀케이션 / 서울특별시 강동구 고덕로 19길 30 / 사업자등록번호 : 212-26-14752 온라인 교육학원업 / 통신판매업신고번호 : 제 2017-서울강동-0002 호 / 개인정보관리자 : 박종흠