When I tried to open vscode in WSL bash on Ubuntu 20.04 using command code ., it failed and the following message was logged:
/mnt/c/Users/john/.vscode/extensions/ms-vscode-remote.remote-wsl-0.50.1/scripts/wslCode.sh: 57: /home/john/.vscode-server/bin/d2e414d9e4239a252d1ab117bd7067f125afd80a/bin/code: not found
I would like to ask how to fix this problem? Thx a lot!
I found the solution. Even though I think that you've already know it.
You need to delete the folder /home/john/.vscode-server/ with sudo rm -rf /home/john/.vscode-server.
Then, you just run code . or try to open any project that you want it.
Then a script will load and will install a new .vscode-server in your machine with the right files.
Related
I can add the "shell command install 'code' command". Testing it works, but if i close out of the VS Code or after a couple of hours of adding the command it doesn't work. Terminal says "zsh: command not found: code" and on VS when click on the "shell command install code command" has a "EACCES: permission denied, unlink 'usr/local/bin/code' " pop up. How should i go about this? I'm using a macbook 2020 if that matters
Uninstall the code command from PATH in VS Code and reinstall it.
Open the command palette in VS Code using cmd + shift + p. Search "uninstall 'code'" and select the first option to uninstall.
Once uninstalled, "install 'code'" for installing.
That should fix it.
This happened to me on Macbook Pro M1 Chip. Basically follow this:
Simply uninstall the code command from PATH in vscode and reinstalled. i.e open the command pallete, search "uninstall 'code'" and select the first option to uninstall. Do same for installing too. That should fix it.
Found this solution on github
Try run:
sudo chown -R yourUsername /usr/local/bin
This command solves user just for copy paste.
sudo chown -R $USER /usr/local/bin
From a sample size of me and three friends, this is a common problem on M1 MacBooks and Mac Minis. Running the command:
sudo chown -R yourUsername /usr/local/bin
This resolved the VS issue for me and allowed me to install npm packages globally.
For Mac I have run below steps in my terminal and it resolve my issue.
you can also Try:
Open terminal.
sudo chown -R your_user_name /usr/local/bin
Open visual studio code.
use keybord command + shift + p
Type the bellow command.
install 'code'
Vs Code
For test go to terminal and run code .
I've run into this a few times on before. Steps I took to that fixed it for me:
open vs code and press cmd + shift + p to open the command palette
search for uninstall 'code' and press Enter
lastly, search for install 'code' and press Enter
For macOS:
Try uninstalling and reinstalling. (command + shift + p) >shell Command: Uninstall 'code' command from Path
append the following to your ~/.bash_profile file (~/.zshrc in case you use zsh).
code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}
I was getting same error to Install on Windows 11:
Just deleted folder C:\Users\my-username\AppData\Local\Programs\Microsoft VS Code\bin
Also removed VS Code from environment variables
Installed successfully!
for any mac users, you can try
sudo rm -f /usr/local/bin/code
That should help. It's important to note that you should be careful using sudo, since you can do a lot of damage in files and folders with it. But in the most dire instances, you should use it, similar to using any kind of --force commands, you should not use it often.
A few days ago I installed Kali Linux. I'm trying to use Code-OSS instead of VSCode, since newest version of Kali doesn't have the libraries needed to install the normal one.
If I try to open a folder in Code-OSS from terminal using code-oss . or code ., it just opens Code on a new 'untitled-1' document, or opens the folder I was before closing Code-OSS. It doesn't open the folder I was in the terminal.
In these cases I need to open the folder I want through File > Open folder > search for folder and then open it.
The same just occurred with git commit or git commit --amend; it opens a new document, not the one I want to open.
I spent sometime searching for a solution on documentation, stackoverflow, google but could not find anything.
I cannot find any way to resolve this problem on Code-oss. Apparently it happened just with me.
Surprisingly for me, I was able to install VSCode following this tutorial, and it apparently managed to ignore the lack of libraries of Kali Linux that I mentioned above.
I hope this solution prevent any person in the future to get stuck on this.
I had the same issue when I first installed Kali-linux on my VM. Pretty anoying.
Just intall vscode by running :
sudo apt update
sudo apt install code
It will unistall code-oss and install VsCode, and it works now.
I edit my code inside tomcat root folder. So I need VSCode to run in mode. I used to write sudo code --user-data-dir and VSCode happily started in root mode. However I do not know what exactly happened yesterday and vscode doesn't simply respond. It doesn't start at all and neither is their any error message. Please help. Noob here
Update : I just figured it out. Apparently there has been an update somewhere and now you need to run sudo code --user-data-dir --no-sandbox
i recommend to use alias to run code --user-data-dir="portable-vscode"
for example
echo "alias vscode='code --user-data-dir="portable-vscode" --no-sandbox --extension-dir portable-vscode/" >> /etc/bash.bashrc
Hey bro open the terminal and type sudo code
I am trying to add flutter to the path but no solution is working for me right now. It was working before when I installed it from snap. Now I am cloning flutter repo into the opt folder and No matter what I try, flutter is not working. I am using ZSH terminal.
So far I have tried:
Adding export PATH=~/opt/flutter/bin:$PATH on last line of .zshrc and .bashrc file.
Running export PATH="$PATH:~/opt/flutter/bin" on the terminal.
And bunch of other tweaks on the keywords but none of the things seems to work.
Try this if you mean you have cloned flutter to /opt folder
export PATH="$PATH:/opt/flutter/bin"
Also if you doesn't mean that and you solely mean ~/opt folder then first verify your flutter installation by typing
~/opt/flutter/bin/flutter
in your terminal,
It should launch flutter it your terminal if not then either your installation is broken or you have to type
chmod +x -R ~/opt/flutter/bin
to make flutter executable if it's not.
PS: Also don't forget to restart your shell if you haven't cause you have to restart you shell after changing something in your .rc files.
I hope I have helped you if not please comment so that I can improve the answer.
This work on Ubuntu.
Add to file .profile the following line:
export PATH="$PATH:/home/your_user_name/opt/flutter/bin
I have on Windows10 and WSL.
vscode is installed on Windows and not on WSL.
When I open WSL and run: code I am getting following error: command not found: code
I have reinstalled vscode and also tried with vscode insider and always checked to add PATH on installation.
The env var PATH does not contain a hint where to look and I also tried "appData/Local/Programs/Microsoft VS Code/bin/code". I am getting an error message: permission denied.
A little bit too late, but in case someone comes here.
The simplest way is to create a symbolic link in /usr/local/bin
ln -s '/mnt/c/Program Files/Microsoft VS Code/bin/code' /usr/local/bin/code
You can use the which command to find where the corresponding program file of the command is stored. This is the output on my WSL:
$ which code
/mnt/c/Program Files/Microsoft VS Code/bin/code