Search code examples
visual-studio-codeterminal

When trying to install VS Code command to PATH, I get "EACCES: permission denied, unlink '/usr/loca/bin/code'"


Im trying to add the command "code" to my VS code path, however when I try to add it in vs code, I get this message saying EACCES: permission denied. Do you know how I can add this to the path? Also, i'm using a mac. enter image description here

enter image description here


Solution

  • Try to uninstall the code command by running Shell Command: Uninstall 'code' command from PATH in the VS Code command palette, and then try installing code to the PATH again. (source).

    If that doesn't work, check the permissions of /usr/local/bin/code with ls -la /usr/local/bin/code. If the root user owns the file, remove it with sudo rm /usr/local/bin/code and then try to add VS Code to the PATH again. (source).