❗ Incorrect Target Target version mismatch. You can specify the target version in vueCompilerOptions.target in tsconfig.json / jsconfig.json. (Expected "target": 2.7) 更改成 "vueCompilerOptions": { "target": 2.7 }还是没有生效
时间: 2024-02-27 19:51:18 浏览: 16
这个错误提示是在使用 Vue.js 2.x 版本时遇到的 TypeScript 的版本不匹配问题。可以尝试以下几个步骤解决:
1. 确认你的项目使用的 Vue.js 版本是 2.x,而不是 3.x。
2. 如果你的项目使用的是 TypeScript,可以在项目根目录下找到 `tsconfig.json` 文件或 `jsconfig.json` 文件,添加如下配置:
```json
{
"vueCompilerOptions": {
"target": "es5" // 或者其他你需要的 TypeScript 目标版本
}
}
```
3. 如果你的项目没有使用 TypeScript,可以尝试升级 Vue.js 版本到最新的 2.x 版本,或者降低 TypeScript 的版本。
如果以上方法还是无法解决问题,可以提供更多的错误信息或者代码片段,以便更好地帮助你解决问题。
相关问题
❗ Incorrect Target Target version mismatch. You can specify the target version in vueCompilerOptions.target in tsconfig.json / jsconfig.json. (Expected "target": 2.7)
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 a different version.
To fix this issue, you can do the following:
1. Open the tsconfig.json/jsconfig.json file in your project.
2. Add a "vueCompilerOptions" object if it doesn't exist already.
3. Inside the "vueCompilerOptions" object, add a "target" property and set it to "es2018" or any other version that matches the expected target version (2.7 in this case).
Here's an example of what the updated tsconfig.json/jsconfig.json file might look like:
```
{
"compilerOptions": {
// your existing compiler options
},
"vueCompilerOptions": {
"target": "es2018"
}
}
```
Once you've made these changes, try running your application again to see if the issue has been resolved.
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![ini](https://img-home.csdnimg.cn/images/20210720083646.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)