【问题标题】:"-bash: //MacOS/Electron: No such file or directory" when using VS Code using " . code " shortcut"-bash: //MacOS/Electron: No such file or directory" when using VS Code using ".code" 快捷方式
【发布时间】:2020-05-06 14:21:09
【问题描述】:

我的 IDE 是 VS Code 我已经用过很多次了 当我在终端中打开 vs 代码时突然

. codesource code

显示错误

-bash: //MacOS/Electron: No such file or directory
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[处理完成]

我该如何解决这个问题?我只是想让我的普通 vs 代码像以前一样再次正常工作

【问题讨论】:

    标签: linux visual-studio-code terminal ide


    【解决方案1】:

    我已经想通了。

    code .

    而不是

    . code

    【讨论】:

    • 非常感谢!解决了一个巨大的头痛
    【解决方案2】:

    试试这个

    cat << EOF >> ~/.bash_profile
    # Add Visual Studio Code (code)
    export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
    EOF
    

    https://code.visualstudio.com/docs/setup/mac

    【讨论】:

    • 我已经解决了。我用这种代码code .而不是. code我不知道为什么它被改变了但它很奇怪..也许它来自以前的更新
    • . code 从 shell 的角度来看没有任何意义。那是不可能的。所有采用文件路径的 unix 命令都像 commandname [filepath] 一样工作,. 是文件路径(当前目录)。
    【解决方案3】:

    对我来说,我没有全局可访问的python。在/usr/local/bin/code 中调用。

    因为我使用的是asdf,所以我只是使用了asdf global python x.xx.x。 如果您没有使用asdf,则可能执行brew install python

    【讨论】:

      猜你喜欢
      • 2016-06-07
      • 2015-10-20
      • 2019-08-26
      • 2020-03-14
      • 2017-02-12
      • 2018-06-10
      • 1970-01-01
      • 2023-04-03
      • 1970-01-01
      相关资源
      最近更新 更多