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.
02、报错原因
不推荐以root账户启动vscode,需要添加参数
03、解决方案
[root@localhost ~]# pwd
/root #在root目录下
[root@localhost ~]# vim .bashrc
添加以下配置文章来源:https://www.toymoban.com/news/detail-810315.html
alias code='/usr/share/code/code . --no-sandbox --unity-launch'
配置生效文章来源地址https://www.toymoban.com/news/detail-810315.html
[root@localhost ~]# source ~/.bashrc
[root@localhost ~]# source ~/.bashrc #再次启动
到了这里,关于Visual Studio Code报错:You are trying to start Visual Studio Code as a super user which isn‘t......的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!