Error: EACCES: permission denied, unlink ‘xxxx/xxxx/xxxx‘ [How to Solve]

Scenario: on the Mac, if you want to use the code command to open vs code, (CMD + Shift + P) search the shell, find this:

Results Click to find:

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

In fact, I don’t have read-write permission, and it’s ineffective to search a lot on the Internet. However, I’m used to using the command line to open vs code. The final solution is:

Enter at the command line

sudo chown -R [yourusername] [filePath]

Yourusername: user preferences – & gt; Users and groups – & gt; Current user
filepath: the path displayed when an error is reported

Tips: if not, try to move the path forward. Take me as an example:

sudo chown -R xxx /usr/local/bin

Read More: