You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Macbook Air M2上OpenAPI (Swagger) Editor扩展无法使用求助

解决OpenAPI (Swagger) Editor扩展在VS Code中无法正常加载的问题

问题详情

  • 设备:Macbook Air M2
  • VS Code版本:1.64.1(Universal)
  • 症状:安装OpenAPI (Swagger) Editor扩展后无法找到该扩展,OPENAPI标签页无内容,重启VS Code、重新安装扩展均无效
  • 错误日志:
[2023-07-21 12:28:57.453] [renderer1] [error] Cannot read property 'installAndRestartMessage' of undefined: TypeError: Cannot read property 'installAndRestartMessage' of undefined
    at vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1570:74473
[2023-07-21 12:31:12.312] [renderer1] [error] command 'openapi.createNewThreeYaml' not found: Error: command 'openapi.createNewThreeYaml' not found
    at b._tryExecuteCommand (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1489:3364)
    at vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1489:3245
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async i.open (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:578:69304)
    at async a.open (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:578:71090)

解决步骤

  • 升级VS Code版本:VS Code 1.64.1属于旧版本,部分新扩展已不再兼容该版本。将VS Code更新到最新稳定版后,重新安装OpenAPI扩展。
  • 清理扩展缓存:
    1. 关闭VS Code
    2. 打开Finder,前往路径:~/Library/Application Support/Code/CachedExtensionVSIXs,删除该目录下所有文件
    3. 前往~/Library/Application Support/Code/User/globalStorage,找到与OpenAPI扩展相关的文件夹并删除
    4. 重启VS Code后重新安装扩展
  • 排查扩展冲突:临时禁用所有其他扩展,仅保留OpenAPI (Swagger) Editor,检查是否能正常加载。若恢复正常,逐个启用其他扩展,定位冲突的扩展并移除或更新。
  • 手动安装VSIX包:从VS Code扩展市场下载OpenAPI (Swagger) Editor的VSIX安装包,打开VS Code后按Cmd+Shift+P,执行Extensions: Install from VSIX...命令,选择下载的安装包完成安装。
  • 重置VS Code设置:备份当前设置后,按Cmd+Shift+P选择Preferences: Reset Settings,恢复默认设置后重新安装扩展。

内容的提问来源于stack exchange,提问作者Victoria Shcherbakova

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 05:10:00