To add code
to PATH in macOS (in order to run code from the command line) we may to open up VS Code and open the 'Command Palette' with Shift+Command+P on Mac, or Shift+Control+P on Linux. In it, enter shell command and look for the Shell Command: Install 'code' command in PATH option. After doing this any new shell we open should be able to run code.
-
-
Save jarek-przygodzki/671e9922c8906fbb78194355acd2f449 to your computer and use it in GitHub Desktop.
👍
Doesn't work. Period.
😎
I think this is what he meant to say:
- In VS Code, open the command palette using Command + Shift + P (Mac) or Command + Control + P (Linux).
- In the VS Code command palette, search/select the option that reads
>Shell Command: Install 'code' command in Path
- Click it (it should say something like "successfully added code to path").
Now try opening a folder in code in your terminal using code .
(if you want to open the current directory in VS Code).
If you get this error from vscode EACCES: permission denied, unlink '/usr/local/bin/code'
Run in a new shell
sudo rm /usr/local/bin/code
Then run the Shell command from vscode again
If you get this error from vscode
EACCES: permission denied, unlink '/usr/local/bin/code'
Run in a new shell
sudo rm /usr/local/bin/codeThen run the Shell command from vscode again
I just found this issue on my Mac, this fix worked for me. Thanks!
Thank you! Works like a charm 🎉
If you get this error from vscode
EACCES: permission denied, unlink '/usr/local/bin/code'
Run in a new shell
sudo rm /usr/local/bin/codeThen run the Shell command from vscode again
That did it, tks sir
Yup it works!!! Thank you
Well that was of no help at all.