代码 .不被识别为内部或外部命令 [英] code . is not recognized as an internal or external command

查看:105
本文介绍了代码 .不被识别为内部或外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Visual Studio代码中使用cmd打开目录,但在cmd中却给我错误.那么,为此需要什么设置?

I want to open directory using cmd in visual studio code but its give me error in cmd. So, What setting is require for that?

我已经执行了以下命令

D:\RND>code .

推荐答案

需要进行设置,以便在您的PATH中找到代码.如果您使用的是 mac 系统,请执行以下操作(对于Windows系统,请阅读以下内容):

It needs to be setup so that Code is found in your PATH. If you're on a mac system, do the following (for windows systems, read below):

  1. 启动VS代码
  2. 打开命令选项板(按 F1 ),然后键入shell command来找到Shell Command: Install 'code' command in PATH command.
  3. 重启终端
  1. Launch VS Code
  2. Open up command palette (press F1) and type shell command to find Shell Command: Install 'code' command in PATH command.
  3. Restart terminal

如果您使用的是Windows,还可以通过添加以下内容来手动设置PATH:

If you're on Windows, you can also set the PATH manually by adding:

C:\Program Files (x86)\Microsoft VS Code\bin

到您的PATH环境变量.

to your PATH environment variable.

  1. 打开命令提示符
  2. 键入setx路径%path%; C:\ Program Files(x86)\ Microsoft VS Code \ bin"
  3. 重启终端

这篇关于代码 .不被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆