Skip to content
LinkedInX

VS Code Insiders - Fixing Shell Recognition Issues

Prerequisites: VS Code Insiders is installed and you know basic terminal operations

When you try to launch VS Code Insiders from the terminal with the code-insiders command, you may see an EACCES: permission denied error. This page explains the cause of the error and two ways to fix it, step by step.

Prerequisites

  • You are using macOS
  • VS Code Insiders is installed
  • You can use a terminal such as Terminal or iTerm2

What the Problem Means: EACCES

EACCES stands for Error: Access, and it appears when access to a file or directory is denied.

When VS Code Insiders tries to register the code-insiders command as a symbolic link in /usr/local/bin, the directory is owned by root, so normal users do not have write permission and the installation fails.

EACCES: permission denied, unlink '/usr/local/bin/code-insiders'

If this happens, running code-insiders . in the terminal may show zsh: command not found: code-insiders.

Change the owner of /usr/local/bin to your own account and create the symbolic link manually.

Steps

Step 1: Check the current permissions

ls -ld /usr/local/bin

Expected output, if the owner is root:wheel, means you need to change it:

drwxr-xr-x  7  root  wheel  ...  /usr/local/bin

Step 2: Change ownership to your account

sudo chown -R $(whoami):admin /usr/local/bin

You will be asked for the administrator password.

Step 3: Remove the old link and create a new one

sudo rm -f /usr/local/bin/code-insiders
sudo ln -s "/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code-insiders" /usr/local/bin/code-insiders

Step 4: Verify it works

code-insiders --version

If a version number appears, it worked.

⚠️ Important Changing ownership of /usr/local/bin may affect other tools such as Homebrew. After the change, check that Homebrew still works normally.

Fix 2: Set an Alias as an Alternative Command

If writing to /usr/local/bin is difficult, you can use the shell’s alias feature to define an alternative command. This approach avoids permission changes and is simpler.

Steps

Step 1: Add an alias to ~/.zshrc

# Add to ~/.zshrc
alias code-insiders="open -n -a 'Visual Studio Code - Insiders' --args"

You can add it directly in an editor, or append it with:

echo 'alias code-insiders="open -n -a '"'"'Visual Studio Code - Insiders'"'"' --args"' >> ~/.zshrc

Step 2: Apply the settings

source ~/.zshrc

Step 3: Verify it works

code-insiders .

If the current directory opens in VS Code Insiders, the setup is successful.

💡 Tip An alias is only valid in the current shell session. Run source ~/.zshrc or restart the terminal to make it available in new windows.

Comparing the Fixes

ItemFix 1 (Change ownership)Fix 2 (Alias)
Ease of useSlightly more complex (sudo required)Simple
Impact on other toolsMay affect Homebrew and othersNone
Full code-insiders commandAvailableUses the open command path
RecommendationEffective as a root fixGood when you want a quick workaround
This table scrolls horizontally. Keyboard users can focus the table and use the left and right arrow keys.

Common Sticking Points

Installation path is different If VS Code Insiders is not under /Applications, the path will differ. Check where it is installed.

find /Applications -name "code-insiders" -type f 2>/dev/null

You forgot to restart the terminal If you do not restart the terminal after changing the settings, the change will not take effect. You can apply it immediately with:

exec $SHELL -l

Confusing Insiders with the regular VS Code VS Code Insiders and the stable VS Code are different apps. Their app names, paths, and commands are different.

ItemStableInsiders
App nameVisual Studio CodeVisual Studio Code - Insiders
Commandcodecode-insiders
This table scrolls horizontally. Keyboard users can focus the table and use the left and right arrow keys.

Summary

StepCommand
Check permissionsls -ld /usr/local/bin
Change ownershipsudo chown -R $(whoami):admin /usr/local/bin
Recreate the linksudo ln -s "…/code-insiders" /usr/local/bin/code-insiders
Alternative with aliasalias code-insiders="open -n -a 'Visual Studio Code - Insiders' --args"
This table scrolls horizontally. Keyboard users can focus the table and use the left and right arrow keys.

Frequently Asked Questions

Q: Is it safe to use sudo? A: sudo runs commands with administrator privileges. The commands here only change settings in your own environment, so they are fine if you understand what they do. Do not use sudo for commands you do not understand.

Q: Can I install code-insiders with Homebrew? A: If you install it with Homebrew Cask using brew install --cask visual-studio-code-insiders, the shell command may be configured automatically. Be careful about conflicts with existing installations.

Q: What if I use Fish? A: For Fish, set the alias in ~/.config/fish/config.fish. Add alias code-insiders "open -n -a 'Visual Studio Code - Insiders' --args" and run source ~/.config/fish/config.fish.

Reference

See the references for the external specifications and background sources used on this page.[1][2]

References

  1. Microsoft, Visual Studio Code documentation
  2. GNU, Bash Reference Manual
Quiz