• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

다시 처음부터 리액트 강의버전으로 진행하려합니다

22.12.29 05:08 작성 조회수 239

0

리액트 파일을 실행하면 처음부터 최신버전으로 만들어져서

react버전과 react-dom 버전을 바꾸었는데

그럼에도 불구하고 route 단독 사용이아닌

routes 를 사용하라고 경고가 뜨길래 최신버전이 적용되는거 같아

 

강사님 깃헙에서 package.json 파일 복붙하고

npm i 하였는데 이제는 yarn start 실행조차 되지않고있습니다

 

노드버전이 문제인걸까요?

:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198: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` succeeded python C:\Users\USER\.conda\envs\django-with-react-rev5\python.EXE
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Users\USER\.conda\envs\django-with-react-rev5\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                       ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:397:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19041
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\django-react\\frontend\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" 
"--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\django-react\frontend\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.13.2
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\USER\AppData\Local\npm-cache\_logs\2022-12-28T19_56_40_823Z-debug.log  

답변 1

답변을 작성해보세요.

1

안녕하세요.

node-sass 라이브러리가 현재는 deprecated된 라이브러리입니다. 게다가 python 버전2에 의존성이 있구요. 에러메세지 중간의 SyntaxError도 파이썬 2 스타일의 print 코드가 내부에 있기 때문에 발생한 듯 보입니다.

node-sass 라이브러리 대신에 dart로 개발된 sass 라이브러리가 이를 대체하니, sass 라이브러리를 설치해서 써보시겠어요?
yarn add -D sass

강의에서는 react-router-dom 버전 5를 사용하고 있으니, 다음 명령으로 버전5를 설치하실 수 있습니다.
yarn add react-router-dom@5.3.4

최신 버전은 6인데요. 6은 강의 완료 후에 업그레이드해보시기를 추천드립니다. 질답에서도 버전6을 시도하신 분들의 질답이 있으니 참고해보시구요.

내년 중순에 본 강의를 업데이트할 예정인데, 그때 모두 최신버전으로 업그레이드할 예정입니다.

화이팅입니다. :-)

ByoungMok Kim님의 프로필

ByoungMok Kim

2022.12.30

업데이트된 버전 기대됩니다! 얼른 되었으면 좋겠네요!