![](/img/trans.png)
[英]Extension 'Prettier - Code Formatter' Cannot Format - (Mac v8.0)
[英]Code formatter 'cannot format' JavaScript file
我正在使用 Macbook,突然我在 VSCode 中的 Prettier 无法正常工作,并在底部栏中显示如下消息:
这是我的 settings.json 文件:
"editor.formatOnSave": true,
"workbench.colorTheme": "Material Theme Darker",
"workbench.iconTheme": "material-icon-theme",
"editor.fontSize": 13,
"[json]": {
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace"
},
"terminal.integrated.automationShell.osx": "",
"terminal.integrated.shell.osx": "",
"terminal.integrated.fontFamily": "\"Meslo LG M for Powerline\"",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.enableDebugLogs": true
}
同样在右下角,它显示了 Prettier 的复选标记,如下所示:
有人可以帮我修复它,我一直在尝试卸载并再次安装 Prettier 或 VScode,但它仍然显示相同的错误消息。
我知道这不是你的问题,因为你的问题已经 10 个月了,但对我来说,几天前版本从 9.0.0 更新到 9.1.0 并且停止工作。 我选择了“卸载/安装另一个版本”并回到 9.0.0,它又开始工作了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.