jsconfig.json 给出 ts 错误 [英] jsconfig.json gives ts errors

查看:22
本文介绍了jsconfig.json 给出 ts 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Nuxt.js 项目在我的根目录中有 jsconfig.json.我有一个错误:

I am having jsconfig.json in my root directory using Nuxt.js project. And I am having an error:

File '/home/mike/Documents/nuxt/node_modules/dotenv/types' not found.
  The file is in the program because:
    Root file specified for compilation

jsconfig.json 的第一行实际上有 5 个错误:

Actually 5 errors in a first line of jsconfig.json:

我什至不使用 typescript 并且我在创建 Nuxt.js 项目

I don't even use typescript and I didn't set any typescript options while creating Nuxt.js project

jsconfig.json 内容:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "~/*": ["./*"],
      "@/*": ["./*"],
      "~~/*": ["./*"],
      "@@/*": ["./*"]
    }
  },
  "exclude": ["node_modules", ".nuxt", "dist"]
}

我不明白它们来自哪里.我如何摆脱这个错误?没有选项quick fix 所以我不能忽略整个文件的错误

I don't understand where they come from. How do I get rid of this errors? There's no option quick fix so I can't ignore errors for entire file

推荐答案

在尝试了几种解决方案后,我刚刚添加了 "exclude": ["node_modules"] 并重新启动了 VScode.错误消失了.

After trying several solutions, I have just added "exclude": ["node_modules"] and restarted VScode. The error went away.

这篇关于jsconfig.json 给出 ts 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆