Home Android code” Error in macOS Terminal

code” Error in macOS Terminal

0
code” Error in macOS Terminal

[ad_1]

The quickest solution to open a folder in VS Code is by utilizing the code command in Terminal. But when you have not configured it appropriately, you may encounter a “zsh: command not discovered: code” error. Comply with these two steps to repair it.


MUO VIDEO OF THE DAY

SCROLL TO CONTINUE WITH CONTENT

1. Reinstall Visible Studio Code

Normally, the beneficial solution to set up software program on a Mac is by way of the App Retailer. Nonetheless, since VS Code is not out there on the App Retailer, downloading it from Visible Studio Code’s official website is your solely choice.

Even for those who did that already, you may nonetheless be operating the app from the Downloads folder in macOS. So ensure you transfer the executable file to the Purposes folder as an alternative.

2. Set up the Code Command to PATH Variables

After transferring VS Code to your Purposes folder, you should add the code command to your PATH variables. As soon as the command is in your PATH setting variables, you’ll be able to run it from the Terminal app in macOS.

Fortunately, you do not have to fiddle with the command line to take action. VS Code supplies a one-click resolution so as to add the command to your PATH variables, by doing the next:

  1. Open VS Code in your Mac.
  2. Press Cmd + Shift + P to open the Command Palette.
  3. Now, kind Shell Command. From the displayed outcomes, choose Set up ‘code’ command in PATH.
    VS Code Command Palette in macOS

  4. Subsequent, VS Code will ask for permission to put in the code command. Choose OK.
  5. Enter your Mac’s admin password within the follow-up immediate and press OK.
    Code command installation confirmation dialog

As soon as completed, a “Shell command ‘code’ efficiently put in in PATH” dialog will seem. Now, even for those who do not know your approach across the Mac Terminal, you’ll be able to rapidly open a folder in macOS by utilizing the code command. Simply open Terminal in your Mac and navigate to the folder utilizing the cd command. When you’re within the folder of curiosity, enter “code .” in Terminal and press Return (or Enter).

As among the finest free code editors, VS Code supplies a wide selection of options that make it simple to develop and debug software program. In the event you choose utilizing Terminal to navigate your file system, the code command makes it simple to open the present folder within the editor.

[ad_2]