❗ 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/Vue/ivue/node_modules/vue/package.json tsconfig: file:///Users/shenglei/Downloads/Vue/ivue/jsconfig.json 具体怎么改
时间: 2023-07-28 12:10:22 浏览: 293
你可以按照以下步骤来解决这个问题:
1. 打开项目根目录下的 `jsconfig.json` 或 `tsconfig.json` 文件,如果没有,可以在项目根目录下创建这个文件。
2. 在 `compilerOptions` 选项中添加 `vueCompilerOptions` 属性,例如:
```
"compilerOptions": {
"vueCompilerOptions": {
"target": "2.7"
}
}
```
这个配置会将 `vueCompilerOptions.target` 设置为 2.7,与你使用的 Vue 版本匹配。
3. 保存文件,重新启动项目。
这样应该就能够解决你遇到的版本不匹配的问题了。希望可以帮到你!
相关问题
❗ 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 like you are encountering a target version mismatch error in your Vue project. This error message is suggesting that the expected target version is 2.7, but your tsconfig.json or jsconfig.json file has a different target version specified. To fix this error, you can add the vueCompilerOptions object to your tsconfig.json or jsconfig.json file and specify the target version as 2.7. Here's an example configuration:
```
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
...
},
"vueCompilerOptions": {
"target": "2.7"
}
}
```
Once you've added this configuration to your tsconfig.json or jsconfig.json file, you should be able to compile your Vue project without encountering the target version mismatch error.
阅读全文