当前位置:   article > 正文

Visual Studio Code报错:You are trying to start Visual Studio Code as a super user which isn‘t......

you are trying to start visual studio code as a super user which isn't recom

01、具体报错

[root@localhost ~]# 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.
  • 1
  • 2
  • 3
  • 4

02、报错原因

不推荐以root账户启动vscode,需要添加参数

03、解决方案

[root@localhost ~]# pwd
/root #在root目录下
[root@localhost ~]# vim .bashrc
  • 1
  • 2
  • 3

添加以下配置

alias code='/usr/share/code/code . --no-sandbox --unity-launch'
  • 1

配置生效

[root@localhost ~]# source ~/.bashrc
[root@localhost ~]# source ~/.bashrc #再次启动
  • 1
  • 2
声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号