typescript 为什么当我从Vite安装React ts时,它在tsconfig中显示错误?

vpfxa7rd  于 2023-04-22  发布在  TypeScript
关注(0)|答案(1)|浏览(627)

我现在已经在Vite中安装了React ts,但它在tsconfig中显示了一个错误,我不知道为什么,因为我甚至还没有尝试更改安装的代码,这是什么原因?
enter image description here
1. error: Specify how TypeScript looks up a file from a given module specifier.
See more: [https://www.typescriptlang.org/tsconfig#moduleResolution](vscode-file://vscode-app/c:/Users/User/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html "https://www.typescriptlang.org/tsconfig#moduleResolution")
Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy.
2. error: Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set.
3. error: Enable importing .json files

ulydmbyx

ulydmbyx1#

尝试将vs代码中的typescript版本更改为“使用工作区版本”like that

相关问题