首页 > 解决方案 > vscode到处给我无效的符号错误

问题描述

我快疯了,VSCode 到处都给我这个错误(包括 js 文件和 .gitignore .dockerignore 文件,即使是简单的行,例如 .gitignore 中的 node_modules )

我需要一些想法

我的配置文件

{
    "workbench.iconTheme": "vscode-icons",
    "workbench.colorTheme": "One Monokai",
    "vsicons.dontShowNewVersionMessage": true,
    "editor.formatOnSave": true,
    "editor.tabSize": 4,
    "prettier.tabWidth": 4,
    "editor.tabCompletion": "on",
    "prettier.singleQuote": true,
    "prettier.printWidth": 80,
    "window.zoomLevel": 0,
    "editor.acceptSuggestionOnEnter": "off",
    "editor.minimap.enabled": false
}

我的扩展非常标准

错误图像

标签: visual-studio-codevscode-settings

解决方案


当安装 macOS 10.15 Catalina 后开始出现此问题时,这些步骤对我有用。

  • 使用 重新安装 node.js nvm,例如nvm install 10 && nvm use 10安装和使用最新的 node.js 10.x 版本(选择您的首选版本)
  • eslint通过重新安装npm i -g eslint
  • 重启 VS 代码

推荐阅读