본문 바로가기
Front-End/개념

[Node.js] 버전 중요성

by 집돌이디벨로퍼 2024. 6. 12.

내가 사용하고 싶은 Template 을 적용하던 중 템플릿에 적용된 모든 pakage.json 내용을 한줄 한줄 체크하면서 적용하고 npm install을 실행해 필요한 의존성을 모두 다운받으려 했는데 자꾸 충돌이 일어나는 것이었다..

C:\Users\----\OneDrive\Desktop\ProjectCollection\src\main\frontwst>npm install
npm warn deprecated osenv@0.1.5: This package is no longer supported.
npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm warn deprecated npmlog@4.1.2: This package is no longer supported.
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
... 생략
npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mn846\\OneDrive\\Desktop\\ProjectCollection\\src\\main\\frontwst\\node_modules\\node-gyp\\bin\\node-gyp.js"
 "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm error gyp ERR! cwd C:\Users\---\OneDrive\Desktop\ProjectCollection\src\main\frontwst\node_modules\node-sass
npm error gyp ERR! node -v v18.20.1
npm error gyp ERR! node-gyp -v v3.8.0
npm error gyp ERR! not ok
npm error Build failed with error code: 1
npm error A complete log of this run can be found in: C:\Users\mn846\AppData\Local\npm-cache\_logs\2024-06-12T06_52_20_149Z-debug-0.log

 

오류코드는 이것이었는데 알아보니 Node의 버전이 너무 높으면 호환이 안되는 문제였다 그래서 node.sass 설치도 안된 것이었고..

 

그래서 버전을 다운그레이드 해줬다

 

 

1. nvm-windows GitHub 페이지에서 nvm-windows를 다운로드하고 설치.

2. 명령 프롬프트나 PowerShell을 열고 다음 명령어를 사용하여 Node.js 버전 14.x를 설치.

3. 아래 코드 입력해 설치

nvm install 14

4. nvm use 14 ( 이부분을 빠트려서 설치된줄 알고 또 여러번 삽질을 해댓다 허허..)

 

다운그레이드 기록 끝..

템플릿에 필요한 의존성들 모두 다운완료!

 

그렇게 Node 버전에 대한 중요성을 깨달았다... 또한 React 도 Node 의 한 부분인것도 내 머릿속에 각인 하던 시간이었다

 

'Front-End > 개념' 카테고리의 다른 글

[Front-end] 모듈 번들  (0) 2024.06.09
DOM 이란??  (0) 2024.04.19