找不到“vite/client”的类型定义文件?

请问一下,tsConfig中报这个错误,应该如何解决?
找不到“vite/client”的类型定义文件,程序包含该文件是因为: 在 compilerOptions 中指定的类型库 "vite/client" 的入口点。
安装版本:"typescript": "^4.9.5", "vite": "^4.4.9"。

tsConfig:
  {
    "compilerOptions": {
      "target": "esnext",
      "module": "esnext",
      "moduleResolution": "node",
      "strict": true,
      "forceConsistentCasingInFileNames": true,
      "allowSyntheticDefaultImports": true,
      "strictFunctionTypes": false,
      "jsx": "preserve",
      "baseUrl": ".",
      "allowJs": true,
      "sourceMap": true,
      "esModuleInterop": true,
      "resolveJsonModule": true,
      "noUnusedLocals": true,
      "noUnusedParameters": true,
      "experimentalDecorators": true,
      "lib": [
        "dom",
        "esnext"
      ],
      "types": [
        "vite/client",
        "jest"
      ],
      "typeRoots": [
        "./node_modules/@types/",
        "./types"
      ],
      "noImplicitAny": false,
      "skipLibCheck": true,
      "paths": {
        "/@/*": [
          "src/*"
        ],
        "/#/*": [
          "types/*"
        ],
        "@/*": [
          "src/*"
        ],
        "#/*": [
          "types/*"
        ]
      }
    },
    "include": [
      "tests/**/*.ts",
      "src/**/*.ts",
      "src/**/*.d.ts",
      "src/**/*.tsx",
      "src/**/*.vue",
      "types/**/*.d.ts",
      "types/**/*.ts",
      "build/**/*.ts",
      "build/**/*.d.ts",
      "mock/**/*.ts",
      "vite.config.ts"
    ],
    "exclude": [
      "node_modules",
      "tests/server/**/*.ts",
      "dist",
      "**/*.js"
    ]
  }
阅读 2.3k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
logo
Microsoft
子站问答
访问
宣传栏