首页 > 解决方案 > 从mac终端启动vs代码时出错

问题描述

我在 mac 上安装了 vs 代码并尝试从终端启动它,但运行以下命令时出现错误:

(base) singhalm ~ $ mkdir home

(base) singhalm ~ $ cd home

(base) singhalm home $ code .

当我运行上述命令时,我收到以下警告和错误:

Syntax Warning: May not be a PDF file (continuing anyway)

Syntax Error: Couldn't read xref table

Syntax Warning: PDF file is damaged - attempting to reconstruct xref table...

Syntax Error: Couldn't find trailer dictionary

Syntax Error: Couldn't read xref table

请注意,我已经按照说明在 VS 代码中设置“Shell 命令:在 PATH 命令中安装“代码”命令”。

我还尝试通过在终端上运行以下命令手动将 VS Code 添加到我的路径中:

cat << EOF >> ~/.bash_profile

export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"

EOF

如何调试问题?

标签: macosterminalvisual-studio-code

解决方案


推荐阅读