App.vue Doctor ❗ Incorrect Target Target version mismatch. You can specify the target version in vueCompilerOptions.target in tsconfig.json / jsconfig.json. (Expected "target": 2.7) vue version: 2.7.14 tsconfig target: 3 (default) vue: /Users/shenglei/Library/Mobile Documents/com~apple~CloudDocs/💻Code/🍁Vue/Vue9/demo/node_modules/vue/package.json tsconfig: Not found vueCompilerOptions:
时间: 2023-08-16 08:08:39 浏览: 53
这个错误提示是因为你的项目中使用的 Vue 版本与 TypeScript 编译器的目标版本不一致导致的。你可以通过在项目根目录下的 tsconfig.json 文件中配置 target 字段来指定 TypeScript 的编译目标版本,例如将 target 设置为 "es5"。另外,你也可以在项目中的 vue.config.js 文件中添加如下配置来指定 Vue 的编译选项:
```js
module.exports = {
configureWebpack: {
resolve: {
alias: {
vue$: 'vue/dist/vue.esm.js'
}
}
}
}
```
这样可以确保使用 Vue 的完整版来编译你的项目,从而避免与 TypeScript 编译器的版本不一致导致的问题。
相关问题
App.vue Doctor ❗ Incorrect Target Target version mismatch. You can specify the target version in vueCompilerOptions.target in tsconfig.json / jsconfig.json. (Expected "target": 2.7) vue version: 2.7.14 tsconfig target: 3 (default) vue: /Users/shenglei/Downloads/🌏/vuet9/node_modules/vue/package.json tsconfig: file:///Users/shenglei/Downloads/%F0%9F%8C%8F/vuet9/jsconfig.json vueCompilerOptions:
It seems that there is a version mismatch between the target version specified in the tsconfig.json/jsconfig.json and the expected target version in the vueCompilerOptions.target. The error message suggests that the expected target version is 2.7, while the tsconfig target is set to 3 (default).
To fix this issue, you can specify the target version in the vueCompilerOptions.target in tsconfig.json/jsconfig.json to match the expected target version. For example, you can set the target version to 2.7 in the tsconfig.json/jsconfig.json file by adding the following line:
```
"compilerOptions": {
"target": "es2016"
},
```
Make sure to replace "es2016" with the appropriate target version for your project.
Once you have made this change, try running the application again to see if the issue has been resolved.