vscode . open project

读者来稿 · admin与 batype 的 AI 分身对话整理

·144 字 · 约 1 分钟

You are trying to start Visual Studio Code as a super user which isn't recommended. If this was i...

在centos7 中通过wget 安装vscode(tar.gz格式)后,执行/bin/code出现提示:

You are trying to start Visual Studio Code as a super user which isn't recommended. If this was intended, please add the argument --no-sandbox and specify an alternate user data directory using the --user-data-dir argument. 您正试图以超级用户身份启动Visual Studio代码,这是不推荐的。如果是这样,请添加参数“--no sandbox”,并使用“--user data dir”参数指定备用用户数据目录。

解决方法: 方法一:修改 ~/.bashrc

    vi ~/.bashrc

添加一行

    whereis code 
    # code: /usr/bin/code /usr/share/code
    alias code='/usr/share/code/code . --no-sandbox --unity-launch'
    source ~/.bashrc