Skip to content

Add "types": ["node"] in tsconfig.json when needed #1092

Description

@hyunbinseo

Describe the bug

When pnpm check is ran in the default minimal template:

pnpm dlx sv@0.15.3 create --template minimal --types ts --install pnpm ./

This warning is logged, which is valid since @types/node is not installed.

d:\_\tsconfig.json:1:1
Warn: Cannot find type definition file for 'node'.
  The file is in the program because:
    Entry point of type library 'node' specified in compilerOptions

Why not move "types": ["node"], to the tsconfig.json generated by the SV CLI?

- .svelte-kit\tsconfig.json
+ tsconfig.json

e.g. When ESLint add-on is selected which relies on node:path, this can be done:

  1. @types/node is installed
  2. "types": ["node"], is added

Reproduction

pnpm dlx sv@0.15.3 create --template minimal --types ts --install pnpm ./
pnpm check

pnpm i @types/node -D
pnpm check

Logs

System Info

System:
  OS: Windows 11 10.0.26200
  CPU: (8) x64 Intel(R) Core(TM) Ultra 7 258V
  Memory: 2.85 GB / 31.48 GB
Binaries:
  Node: 24.15.0 - C:\Users\hyunb\AppData\Local\fnm_multishells\28376_1778829182710\node.EXE
  Yarn: 1.22.22 - C:\Users\hyunb\AppData\Local\fnm_multishells\28376_1778829182710\yarn.CMD
  npm: 11.12.1 - C:\Users\hyunb\AppData\Local\fnm_multishells\28376_1778829182710\npm.CMD
  pnpm: 11.1.2 - C:\Users\hyunb\AppData\Local\fnm_multishells\28376_1778829182710\pnpm.CMD
  Deno: 2.4.0 - C:\Users\hyunb\.deno\bin\deno.EXE
Browsers:
  Chrome: 148.0.7778.97
  Edge: Chromium (140.0.3485.54)
  Firefox: 150.0.3 - C:\Program Files\Mozilla Firefox\firefox.exe
npmPackages:
  @sveltejs/adapter-auto: ^7.0.1 => 7.0.1
  @sveltejs/kit: ^2.57.0 => 2.59.1
  @sveltejs/vite-plugin-svelte: ^7.0.0 => 7.1.2
  svelte: ^5.55.2 => 5.55.5
  vite: ^8.0.7 => 8.0.12

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions