문제해결 : Failed to write the global types file. Make sure that: 1. "node_modules" directory exists. 2. "vue" is installed as a direct dependency. Alternatively, you can manually set "vueCompilerOptions.globalTypesPath" in your "tsconfig.json" or "jsconfig.j

2025. 9. 12. 17:13·etc

⛔ 문제사항

어쩌다보니 Vue까지 하게 됐는데 (땀땀) 묘하게 거슬리는 워닝이 자꾸 떠서 살펴보니 이런 경고였다.

Failed to write the global types file. Make sure that: 1. "node_modules" directory exists. 2. "vue" is installed as a direct dependency. Alternatively, you can manually set "vueCompilerOptions.globalTypesPath" in your "tsconfig.json" or "jsconfig.json". If all dependencies are installed, try running the "vue.action.restartServer" command to restart Vue and TS servers.vue(404)

 

✅ 해결방안

사실 워닝 자체에 해결방법이 다 쓰여져 있기 때문에 크게 어려운 점은 없을 것이다.

 

  1. node_modules가 있는지 확인할 것
  2. vue의 의존성이 제대로 설치 되어있는지 config.json파일을 확인할 것
  3. 모두 확인해봤는데 안 된다면 vue 서버를 재실행할 것.

 

1. node_modules 확인하기

일반적으로 node_modules가 없기란 힘들다. 있기도 하니 고로 1번은 패스.

 

2. vue 의존성 및 jsconfig.json 파일 확인하기

vue의 의존성이 제대로 되어있는지 아래 명령어를 통해 확인해보니,

 

npm list vue

딱히 문제는 없어보였다. 그렇다면 tsconfig.js 혹은 jsconfig.js를 수정하면 된다.

{
  "compilerOptions": {
    "target": "ES2020",
    "useDefineForClassFields": true,
    "lib": ["ES2020", "DOM", "DOM.Iterable"],
    "module": "ESNext",
    "skipLibCheck": true,
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "preserve",
    "strict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noFallthroughCasesInSwitch": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": [
    "src/**/*.ts",
    "src/**/*.tsx",
    "src/**/*.vue",
    "src/**/*.js",
    "src/**/*.jsx"
  ],
  "exclude": ["node_modules", "dist"],
  "vueCompilerOptions": {
    "globalTypesPath": "./node_modules/vue/global.d.ts"
  }
}

jsconfig.js 파일도 위와 같이 수정.

공교롭게도 난 그래도 안 됐다.

 

3. vue server 재실행

그렇다면 이제 뷰서버를 재실행하는 방법만 남았으니 cmd + shift + p 단축기를 이용하여 아래 명령어를 검색한 뒤 실행한다.

Vue: Restart Vue server

 

워닝이 알려준 절차대로 하니 깔끔하게 워닝이 사라진 모습을 볼 수 있다.

만약 그래도 워닝이 사라지지 않는다면 vsc 자체를 껐다 켜보는 것도 추천한다.

저작자표시 비영리 (새창열림)

'etc' 카테고리의 다른 글

localhost:8080 모바일에서 열기  (0) 2025.12.16
문제해결 : zsh: command not found: ls  (0) 2025.10.02
스파르타 국비지원 내일배움캠프? 경력직이 듣기엔 어떨까?  (8) 2024.10.13
모의면접 준비 2차  (0) 2024.09.26
모의면접 준비 1차  (0) 2024.09.12
'etc' 카테고리의 다른 글
  • localhost:8080 모바일에서 열기
  • 문제해결 : zsh: command not found: ls
  • 스파르타 국비지원 내일배움캠프? 경력직이 듣기엔 어떨까?
  • 모의면접 준비 2차
깨비도
깨비도
그림 그리는 개발자의 인디게임 생존기 & Flutter 연구소
  • 깨비도
    KKEVi.log()
    깨비도
  • 전체
    오늘
    어제
    • 전체 (98) N
      • 인디게임 개발일지 (6) N
      • C# (1)
      • Dart (3)
      • Flutter (24)
        • 문제해결 (14)
      • Kotlin (12)
      • Android (22)
        • 문제해결 (11)
      • CS (10)
        • Network (1)
      • 알고리즘 (10)
        • 코딩테스트 (10)
      • etc (10)
        • Git (1)
        • React (1)
  • 블로그 메뉴

    • 방명록
  • 링크

    • 그림 전문 일지
  • 공지사항

  • 인기 글

  • 태그

    MacOS
    ram
    게임개발
    XML
    Unity이펙트
    context
    flutter
    DartVM
    게임기획
    인디게임
    Firebase
    유니티
    when
    OS
    stack
    C#
    네트워크
    게임아트
    인디게임개발
    Gemini
    플러터
    CS
    플랫포머_배경
    Dear.MyMarionette
    Android
    DART
    Kotlin
    2D아트워크
    IOS
    thread
  • 최근 댓글

  • hELLO· Designed By정상우.v4.10.5
깨비도
문제해결 : Failed to write the global types file. Make sure that: 1. "node_modules" directory exists. 2. "vue" is installed as a direct dependency. Alternatively, you can manually set "vueCompilerOptions.globalTypesPath" in your "tsconfig.json" or "jsconfig.j
상단으로

티스토리툴바