Vetur出现找不到tsconfig.json或jsconfig.json的错误

7
我在为我的项目创建新的Vue页面时,一直遇到错误。错误显示为:

Vetur无法在/xxxx/xxxxxx中找到tsconfig.jsonjsconfig.json

有什么解决方法可以解决这个问题吗?
1个回答

6

创建文件 :)

查看文档

// tsconfig.json
{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    // this enables stricter inference for data properties on `this`
    "strict": true,
    "jsx": "preserve",
    "moduleResolution": "node"
  }
}

我应该将它添加到vue文件夹还是package.json文件中? - JohnwasHere
1
@JohnwasHere 将文件添加到项目的根目录,与 package.json 文件在同一个文件夹中 :) - tauzN
它是一个单独的文件添加到文件夹中,还是一个代码块添加到package.json文件中? - JohnwasHere
2
@JohnwasHere 在你的项目目录中创建一个名为 tsconfig.json 的新文件,并将答案中的内容粘贴进去。 - tauzN
package.json文件应该包含什么内容? - Binaya Thapa Magar
1
我很不高兴 vue create 没有自动提供这个文件。话虽如此,我对 Vetur 和 vue-cli 的工作方式并不熟悉。 - Nuclear03020704

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接