无法使ESlint在VSC上运行,继续出现'Json中出现意外错误...'

问题描述 投票:0回答:1

我正在学习JS,正在尝试安装ESlint,但仍然出现相同的错误。

只是试图在VSC上安装ESlint,但从未使其正常运行。我已经卸载并重新安装了eslint,清理了缓存,安装并删除了多个软件包均未成功,但返回时出现相同的错误。

package.json

{
  "name": "11_06",
  "version": "1.0.0",
  "description": "",
  "main": "script.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {},
  "devDependencies": {
    "tslib": "^1.10.0"
  }
}

错误消息:

"ESLint: Unexpected token n in JSON at position 173. Please see the 'ESLint' output channel for details."

我可以在第173行的位置/方式/位置查看哪个文件?

javascript visual-studio-code eslint
1个回答
0
投票

更新:

我找到了问题的根源,尽管使用推荐的方法通过npm或自动安装在全球和本地正确地安装了eslint几次,然后在全局和本地进行清理缓存并一次又一次地尝试,但最终我发现eslint的方式存在问题安装在我的VSC上,我不知道为什么,但是它没有使用基本信息创建eslintrc.json文件。手动创建后,eslint开始工作。仍然不知道我最初做错了什么。祝你好运。

© www.soinside.com 2019 - 2024. All rights reserved.