티스토리 뷰

반응형

 

 

 

 

 



 

 

nodedotjs

 

 

 

 

노드 템플릿을 하나 사용하게 되어 셋팅 후 npm install 을 수행했는데

아래와 같이 오류가 났다.

 

npm error code 3221225477 
npm error path D:\...\node_modules\node-sass 
npm error command failed 
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c 
node scripts/install.js 
npm error A complete log of this run can be found in: C:\...\AppData\Local\npm-cache\_logs\2025-08-18T03_06_28_934Z-debug-0.log

 

 

node-sass의 문제인건 아는데 정확하게 뭔지 알 수 없기에 로그 파일을 찾아 열어보았다.

 

verbose pkgid node-sass@7.0.3 
error code 3221225477
...

 

 

node-sass 7 버전으로 내 pc에 설치된  nodejs 와의 버전 호환 문제였다.

설치된 나의 node 버전은 22였다. 

 

 

 

  • Node 20node-sass 9.0+ 필요
  • Node 18node-sass 8.0+ 필요
  • Node 17node-sass 7.x 가능
  • Node 16node-sass 6.x+ 가능

 

 

 

node 17 로 다운그레이드가 필요한 상황인데

어차피 템플릿 빌드용으로 필요해서 도커를 이용해서 해당 문제를 해결하기로 했다.

 

 

 

 

 

 

 


Docker

 

 

docker pull node:17.9.1
docker run -it --name node17 -v {#템플릿경로}:/app -v ats_node_modules:/app/node_modules -w /app node:17.9.1

 

 

모듈 호환되는 노드17 버전을 가져온 후 실행했다.

 

템플릿 경로에서 docker 를 실행하면 경로를 .(dot) 으로 간편하게 작성할 수 있다.

그리고 그렇게 진행하니 이슈가 하나 있었는데

 

도커 Volume 명을  기존 템플릿 경로에 있는 폴더(node_modules)랑 동일하게 했더니 

도커 Volume 을 보는게 아니라 실제 경로를 바라보게 되었다.

 

그래서 정확하게 마운트 지점을 알려주거나

볼륨명을 다르게 하면 도커 볼륨으로 잘 마운트 되는 것을 확인했다.

 

 

이제 도커 노드에서 npm install 을 수행하니 버전 충돌 오류 없이 잘 모듈들이 생성되었고

템플릿을 컴파일할 gulp 로 태스크 러너가 잘 동작하는 것을 확인 했다.

 

 

# npx gulp
[08:15:41] Using gulpfile /app/gulpfile.js
[08:15:41] Starting 'default'...
[08:15:41] Starting 'clean'...
[08:15:41] Finished 'clean' after 228 ms
[08:15:41] Starting 'fileIncludeAll'...
[08:15:43] Finished 'fileIncludeAll' after 1.6 s
[08:15:43] Starting '<anonymous>'...
[08:15:43] Finished '<anonymous>' after 168 ms
[08:15:43] Starting 'scss'...
[08:15:47] Finished 'scss' after 3.68 s
[08:15:47] Starting 'browserSync'...
[08:15:47] Finished 'browserSync' after 10 ms
[08:15:47] Starting 'watch'...
[Browsersync] Access URLs:
 ----------------------------------------------
       Local: http://localhost:3000/index.html
    External: http://172.17.0.3:3000/index.html
 ----------------------------------------------
          UI: http://localhost:3001
 UI External: http://localhost:3001
 ----------------------------------------------
[Browsersync] Serving files from: ./src/.tmp
[Browsersync] Serving files from: ./src
[Browsersync] Serving files from: ./
[Browsersync] Watching files...
[Browsersync] Couldn't open browser (if you are using BrowserSync in a headless environment, you might want to set the open option to false)

 

 

 

 

 

 

 

 



 

 

 

 

 

 

 

반응형
댓글
반응형
최근에 올라온 글
«   2026/01   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Total
Today
Yesterday